Programming 'F407 ...

Working libraries, libraries being ported and related hardware
edogaldo
Posts: 284
Joined: Fri Jun 03, 2016 8:19 am

Re: Programming 'F407 ...

Post by edogaldo » Mon Oct 10, 2016 10:31 am

Rudi, if you upload a very basic sketch with just 1 led blink, does it work?

I had a relatively similar issue on a F1 board: in my case it was due to a micro shortcut between the HSE pins (due to poor soldering) which prevented the correct startup of the HSE..
Symptoms in my case:
  • the USB didn't work
  • Blinking worked but with incorrect timings when trying to use the PLL, the reason was that the PLL startup was failing and the HSI was used instead..
  • furthermore: if I correctly remember blink worked only when using a SPL blink example; using an Arduino library sketch blink was not working, probably due to failure in initializing the USB Serial interface..
I could fix the problem cutting the shortcut.

hope this can help..
Last edited by edogaldo on Mon Oct 10, 2016 11:29 am, edited 2 times in total.

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Programming 'F407 ...

Post by RogerClark » Mon Oct 10, 2016 10:53 am

Hi Rudi

Are you making your own boards ?

clock could be an issue.

I think the code waits for HSE to start, in an infinite loop. I don't think there is any code to timeout waiting for HSE then attempts to restart

I have a similar issue with a F103 board, it only works if I upload via serial (I havent tried STLInk), and run straight away, but if I power cycle, the board does not run

I presumed it was a faulty clock, but its not a good board, so I simple don't use it any more.

User avatar
luudee
Posts: 17
Joined: Sat Oct 08, 2016 4:27 pm
Location: Pattaya
Contact:

Re: Programming 'F407 ...

Post by luudee » Mon Oct 10, 2016 12:26 pm

Hi Guys,

I am using a very basic sketch, wich makes two LEDs blink (one on the
MCU board) and one on my base board). This is just in case the LED
on the CPU board does not work ...

The MCU boards I am using, I bought online:
https://www.aliexpress.com/item/STM32F4 ... 85751.html

I have made a base board where they plug it in. But I can operate them
outside my base board or plugged in, it doesn't matter. Results are the same.

I have been thinking about HSE, and did add a "USE_HSI" ifdef block
in your libraries, Roger. Now am trying to find the correct place in Koduino.

I did a physical inspection and did not see anything wrong, like solder
shorts.

I have one question about the vector tables. I noticed that the vector table
might have something like this:

0800 1ffd, Reset Vector
0800 0d1d, NMI Vector

In both cases it's an odd address, bit 0 is set (this actually applies to all
vectors).

But the actual locations are:
08001ffc <Reset_Handler>:
08000d1c <NMI_Handler>:

What is going on here ? It's like actual address + 1 ?! This does work on 6 of
my boards, so it must be correct !

But I still would like to understand it. I have been searching through the almost
2000 pages of the programming manual, and nothing so far ...

Many thanks !!!
rudi
Attachments
base_board.jpg
base_board.jpg (229.38 KiB) Viewed 383 times

stevestrong
Posts: 1813
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Programming 'F407 ...

Post by stevestrong » Mon Oct 10, 2016 1:32 pm

Odd and even addresses in vector table (see the 1st answer):
http://stackoverflow.com/questions/1576 ... dd-address
Last edited by stevestrong on Mon Oct 10, 2016 1:58 pm, edited 5 times in total.

edogaldo
Posts: 284
Joined: Fri Jun 03, 2016 8:19 am

Re: Programming 'F407 ...

Post by edogaldo » Mon Oct 10, 2016 1:51 pm

The fact that the behaviour is different in different boards of the same type leads me to thinking it should be a specific board issue (either at board level or at chip level).
Afaik there are no fuses or stuff like that in the STM32 chips..

edogaldo
Posts: 284
Joined: Fri Jun 03, 2016 8:19 am

Re: Programming 'F407 ...

Post by edogaldo » Mon Oct 10, 2016 2:55 pm

Another "silly" question: since that board is available in both F103VET6 and F407VET6 versions, you sure the failing boards are not F103 versions?! :D

User avatar
luudee
Posts: 17
Joined: Sat Oct 08, 2016 4:27 pm
Location: Pattaya
Contact:

Re: Programming 'F407 ...

Post by luudee » Mon Oct 10, 2016 3:12 pm

Thanks for that odd/even pointer Steve !

Edogald, yeah they F407 device. And I don't trust whats printed on them eiter - it's coming from china after all. So I run this:

% st-info --probe
Found 1 stlink programmers
serial: 523f7106517755563306153f
openocd: "\x52\x3f\x71\x06\x51\x77\x55\x56\x33\x06\x15\x3f"
flash: 524288 (pagesize: 16384)
sram: 196608
chipid: 0x0413
descr: F4 device

So it is a F4 !

Cheers,
rudi

edogaldo
Posts: 284
Joined: Fri Jun 03, 2016 8:19 am

Re: Programming 'F407 ...

Post by edogaldo » Mon Oct 10, 2016 5:30 pm

luudee wrote:Thanks for that odd/even pointer Steve !

Edogald, yeah they F407 device. And I don't trust whats printed on them eiter - it's coming from china after all. So I run this:

% st-info --probe
Found 1 stlink programmers
serial: 523f7106517755563306153f
openocd: "\x52\x3f\x71\x06\x51\x77\x55\x56\x33\x06\x15\x3f"
flash: 524288 (pagesize: 16384)
sram: 196608
chipid: 0x0413
descr: F4 device

So it is a F4 !

Cheers,
rudi
Ok, another suggestion: did you try using the standard STM DFU bootloader? It can be a good way to check whether HSE and PLL work correctly..

User avatar
luudee
Posts: 17
Joined: Sat Oct 08, 2016 4:27 pm
Location: Pattaya
Contact:

Re: Programming 'F407 ...

Post by luudee » Mon Oct 10, 2016 7:21 pm

Hi Guys !

Finally some good new !

All of my boards are working now. As many of you have suggested, the external Clock Oscillator
was not working properly (or most likely the external Crystal or the load capacitors are no good).

Anyway, I made some changes to the SetSysClock() routine to select HMI and also modified the
way the other dividers were generated to automate the whole process a bit. BTW, it looks lie all
the libraries I looked at so far, use exactly the same SetSysClock() routine with very little changes ....

Many Thanks !
rudi

User avatar
RogerClark
Posts: 7443
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Programming 'F407 ...

Post by RogerClark » Mon Oct 10, 2016 9:16 pm

Rudi

Ok. Its not the first time we have seen an issue with a dodgy external clock ;-)

Can you post a snipped of your updated / improved clock code

Post Reply