Q: Nucleo F401 with UART bootloader

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
ubiq_01
Posts: 26
Joined: Mon Feb 08, 2016 1:45 pm
Location: Dresden, Germany

Q: Nucleo F401 with UART bootloader

Post by ubiq_01 » Tue Feb 16, 2016 12:20 pm

Did anybody try using the UART based bootloader (not the USB dfu-util one) on the Nucleo F401?

I try setting BOOT0 (on the Morpho header) HIGH (jumper to +3.3V next to it on the header) and use UART6 (on C6/C7, I intentionally
didn't want to use the UART that the st-link interface / VCP is connected to) with the stm32flash tool https://github.com/ARMinARM/stm32flash . Yet, so far there seems to be no reaction from the bootloader.

Should I disconnect the ST-Link part? Any other hints? (I will try to check with a small program trying to check the "send 1 byte / get
answer from bootloader" mechanism next).

best regards
Ralf

ubiq_01
Posts: 26
Joined: Mon Feb 08, 2016 1:45 pm
Location: Dresden, Germany

Re: Q: Nucleo F401 with UART bootloader

Post by ubiq_01 » Tue Feb 16, 2016 1:31 pm

I can provide a 1st answer myself:
- The USART bootloader can be used - but just with USART1 and 2 (see application node AN2606 http://www.st.com/web/en/resource/techn ... 167594.pdf that I read meanwhile).

I successfully use USART1 with an external USB/serial adapter now.
==
$ ./stm32flash -w ~/firmware.bin /dev/tty.usbserial-DN009NWZ
stm32flash 0.5

http://stm32flash.sourceforge.net/

Using Parser : Raw BINARY
Interface serial_posix: 57600 8E1
Version : 0x31
Option 1 : 0x00
Option 2 : 0x00
Device ID : 0x0433 (STM32F401xD(E))
- RAM : 96KiB (12288b reserved by bootloader)
- Flash : 512KiB (size first sector: 1x16384)
- Option RAM : 16b
- System RAM : 30KiB
Write to memory
Erasing memory
Wrote address 0x0805da7c (100.00%) Done.
==

My initial problem (why I started examining the "alternative bootloader way") remains: Whereas I'm able to run
the Nucleo F401 "nuraci" port - I fail with both the "cnoviello" sources as well as with those from the recent micropython github.

I don't get a REPL prompt (neither on USART2 nor USART6 if I reconfigure for that (which works for the "nuraci" version)). Anybody
(apart from Dave) actively using this board?

best regards
Ralf

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Q: Nucleo F401 with UART bootloader

Post by dhylands » Tue Feb 16, 2016 6:58 pm

Maybe your board is slightly different?

Mine says NUCLEO-401RE on it.

I put a couple photos over here:
https://www.dropbox.com/s/6j11wckbp0mii ... t.jpg?dl=0
https://www.dropbox.com/s/j933mmhzh6sep ... k.jpg?dl=0

They show which solderballs are installed (IIRC mine is stock and I haven't changed anything)

ubiq_01
Posts: 26
Joined: Mon Feb 08, 2016 1:45 pm
Location: Dresden, Germany

Re: Q: Nucleo F401 with UART bootloader

Post by ubiq_01 » Wed Feb 17, 2016 1:24 am

Hello Dave,

your photos are helpful! My boards have a MB1136 C-01 sticker - and there is a difference that http://www.st.com/web/en/resource/techn ... 105823.pdf mentions.

"The board marking MB1136 C-01 corresponds to a board configured as LSE (low speed clock) not used."
The crystal X2 (top view, bottom left) is not populated.

Do you think that could be coped with in the configuration? I might also find a relevant difference between the
"nuraci" code that works and the now "mainstream one".

At least 1 step further! :-)

best regards
Ralf

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Q: Nucleo F401 with UART bootloader

Post by dhylands » Wed Feb 17, 2016 2:37 am

X2 is a 32.768 kHz crystal used for the RTC.

X3 is the high speed crystal (which is provided using the MCO signal on this board)

It looks like if you put a solderball (or zero-ohm resistor) across SB16 (top left looking at the photo of the back) and SB50, bottom middle, above the 1 in the MB1136 (note both SB50 and SB16 also have the label MCO under them), then you'd have MCO driving the clock on the 401. I suspect that your board is missing one or both of SB16/SB50

Without that, the 401 will be falling back to it internal oscillator which is 16MHz. It looks like the current configuration is expecting 8MHz HSE (which is what the MCO signal provides), so that probably explains why you're not seeing a REPL. If it's running at 16 MHz insteasd of 8MHz, then all of the frequencies would be messed up.

I'm pretty sure that you don't need X2 (i have other boards like the G30HDR which have an HSE and no LSE).

ubiq_01
Posts: 26
Joined: Mon Feb 08, 2016 1:45 pm
Location: Dresden, Germany

Re: Q: Nucleo F401 with UART bootloader

Post by ubiq_01 » Wed Feb 17, 2016 9:01 am

Hello Dave,

many thanks! You are right - the solder bridges that you refer to are not closed on my board. Unfortunately (and as stated in
http://www.st.com/web/en/resource/techn ... 105823.pdf where it talks about the HSE clock source)
there are others present / that would need to be removed.

I'll try getting a newer revision board first - and only if this fails will start modifying the board.

best regards
Ralf

ubiq_01
Posts: 26
Joined: Mon Feb 08, 2016 1:45 pm
Location: Dresden, Germany

Re: Q: Nucleo F401 with UART bootloader

Post by ubiq_01 » Thu Feb 18, 2016 6:45 pm

Success! I got a Nucleo F411 (revision C-03 with proper HSE) and it works well with the recent github sources and the F401 settings.

Thanks for the support!
Ralf

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: Q: Nucleo F401 with UART bootloader

Post by jgriessen » Sun Jun 26, 2016 3:45 pm

I'm studying how to load micropython into a nucleo-F401RE today, so any pointers will be appreciated.
John Griessen blog.kitmatic.com

ubiq_01
Posts: 26
Joined: Mon Feb 08, 2016 1:45 pm
Location: Dresden, Germany

Re: Q: Nucleo F401 with UART bootloader

Post by ubiq_01 » Sun Jun 26, 2016 3:52 pm

Be sure to check which revision of the board you have. See the messages - it was simple with the newest one but problematic with the older ones.

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: Q: Nucleo F401 with UART bootloader

Post by jgriessen » Sun Jun 26, 2016 4:15 pm

Be sure to check which revision
Mine is MB1136 C-03
John Griessen blog.kitmatic.com

Post Reply