Porting to STM32F401C

Posted on
  • Hi, I made a new board, csv, and altered the makefile by cutting and pasting STMF4's setup. I am getting RAM errors. The 401C has 256KB Flash and 64KB RAM. Is there anything I can do to help make it fit?

  • RAM errors? you mean during the compile?

    You should change what's in the .py file... I guess you've already changed the RAM and ROM values, but you should also change the variables value. Very roughly, variables should be (RAM-12000)/20 - so try 2600.

  • I would calculate 2600 (typo or misunderstanding on my side?)

  • thanks. Yes - typo. I'll just fix it ;)

  • OK thanks! I got it farther now. It appears I just need to fit it into the flash:
    LD espruino_1v60_stm32f401Cdiscovery.elf
    GEN espruino_1v60_stm32f401Cdiscovery.lst
    GEN espruino_1v60_stm32f401Cdiscovery.bin
    bash scripts/check_size.sh espruino_1v60_stm32f401Cdiscovery.bin
    FAIL - size of 199436 is over 131072 bytes
    make: *** [espruino_1v60_stm32f401Cdiscovery.bin] Error 1

  • Nevermind, I see that the size is probably fine compared to regular F4. I went ahead and uploaded it, but it's USB is not coming up. Should it be set up any different since it has only a USB OTG port?

  • Presumably you haven't set up the ram/rom correctly in the .py file? that would fix your errors.

    As far as USB - does it actually work on serial? might be worth trying just to make sure.

    You'll have to work out what's wrong with USB yourself I'm afraid by comparing it with ST's examples. I think ST may have changed their peripheral slightly from the F407.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Porting to STM32F401C

Posted by Avatar for FyberChris @FyberChris

Actions