Page 1 of 1

STM32L496RE firmware for custom board

Posted: Thu Jun 18, 2020 10:45 am
by maryem.cherif
Hello,
I have a custom board that contains the STM32L496RE microcontroller I wanted to upload the micropython firmware into my board and I used the firmwares from the https://github.com/micropython/micropython repository in github, first

I created a folder named NEWBOARD for my board under micropython/ports/stm32/boards

Copied into it the files used in the NUCLEO_L476RG (in folder NUCLEO_L476RG under micropython/ports/stm32/boards) since I have the Nucleo and it shares the same core with my custom board , and I changed the pins according to my custom board in the mpconfigboard.h under micropython/ports/stm32/boards/NEWBOARD

Copied the .ld file used for the Nucleo board stm32l476xg.ld found under micropython/ports/stm32/boards and then I changed the memory addresses according to my board

Changed the reference of the .ld file (line 4) in the mpconfigboard.mk file located under micropython/ports/stm32/boards/NEWBOARD

Changed line 52 in the Makefile located in micropython/ports/stm32 as follows:

Code: Select all

OPENOCD_CONFIG ?= boards/openocd_stm32l4.cfg
Then, I ran

Code: Select all

make BOARD=NEWBOARD
in micropython/ports/stm32

The firmware was built and I tried to flash it into my board using

Code: Select all

make BOARD=NEWBOARD deploy-openocd 
,(I made sure the board was connected to the computer and it showed in the terminal)

It didn't work so I tried it with

Code: Select all

make BOARD=NEWBOARD deploy-stlink
, it said that the memory was successfully flashed but when I opened the serial connection using picocom , none of the micropython commands worked (Ex : pyb.LED(2).on() ) knowing that they worked fine when I flashed the NUCLEO_L476RG
I assumed the firmware didn't flash at all, so I moved the binary file (firmware.bin that was created in micropython/ports/smt32/build-NEWBOARD after I built the board files) to Windows (knowing that I was using Ubuntu) and I flashed the board using st-link Utility, it worked apparently but it still didn't respond to any of the micropython commands, instead the LEDs mentioned in mpconfigboard.h kept blinking without any command from me, they start blinking whenever I power on the board, knowing that when I only put one pin in the mpconfigboard.h , only the LED mentioned will blink, when I put two, they both blink.

I couldn't know the reason behind the blinking, and I couldn't figure out why the firmware that I configured didn't work properly on my board.
I would appreciate it if someone could give me further explanation about how this firmware works or why am I having this issue.

Also, are there any more configurations or files that I should modify to have a working firmware for my custom board ?
Thank you very much