Page 1 of 1

MicroPython on STM32L496RGT6 for a new board

Posted: Tue Feb 11, 2020 6:05 pm
by nodemite
Hello to all
I would like to know if it is possible to port on this micro:
STM32L496RGTx with 1Mb of flash and 320Kb of RAM, uSD, USB, two 2 resonators for RTC and USB and other features.
Do you think it will be difficult to do the porting?
For the USB resonator do you recommend 12 or 24Mhz?
Thanks

Re: MicroPython on STM32L496RGT6 for a new board

Posted: Tue Feb 11, 2020 10:19 pm
by jimmo
nodemite wrote:
Tue Feb 11, 2020 6:05 pm
Do you think it will be difficult to do the porting?
There's already a board definition for this chip. https://github.com/micropython/micropyt ... 2L496GDISC

Although that's not for the RGTx, you might need to make a custom linker script for your flash/ram size.

Re: MicroPython on STM32L496RGT6 for a new board

Posted: Fri Feb 14, 2020 9:15 pm
by nodemite
Hi jimmo
Thanks, I am currently developing a board with STM32L496RGx 1M flash/320K Ram, with uSD 4wire, SPI, UART, I2C etc, 2 crystals, one of which for USB.
Would it be useful to follow some tutorials to start from scratch? I mean to do the porting
Thanks

Re: MicroPython on STM32L496RGT6 for a new board

Posted: Sat Feb 15, 2020 1:19 am
by jimmo
nodemite wrote:
Fri Feb 14, 2020 9:15 pm
Would it be useful to follow some tutorials to start from scratch? I mean to do the porting
Sorry there aren't any tutorials on this, but the basic idea is to start with a copy of the board directory that you're basing this on (i.e. ports/stm32/STM32L496DISC), and go through line by line of each of the four files (they're all pretty short) and update them to match your board.

It looks like you'll even be able to use the existing linker script (stm32l496xg.ld -- 1MiB flash / 320kiB ram), so really all you have to do is set the board name, clock params, and enable/disable any features.

Something like:

Code: Select all

cd ports/stm32
cp -r boards/STM32L496DISC boards/MYBOARD
edit boards/MYBOARD/mpconfigboard.h, mpconfigboard.mk, pins.csv, stm32l4xx_hal_conf.h
make BOARD=MYBOARD
make BOARD=MYBOARD deploy # this will use st-link