STM32 F4 Discovery memory #7576
Replies: 1 comment
-
Posted at 2024-10-29 by @gfwilliams Hi, Espruino works off a fixed size memory area, and the default build just uses what's in the bare chip. You'd have to make your own build that enabled PSRAM/ext flash/etc, and then yes, you could relocate vars into that (assuming it was memory mapped?). Writing to external flash might be more of an issue, I think you may have to implement that yourself in jshardware.c if the standard STM32 flash write functions won't do it. ... but it's definitely possible to do, just not with a plain build Posted at 2024-11-01 by MarkBloom Hi. Thanks for the quick response, @gfwilliams! Sorry for the unclear question, as I was too hasty and misinterpret what we actually want. For our educational platform project we're planning to build our own board based on STM32F405 or STM32F407 chip (most likely 407). If I understand correctly, Espruino does support these chips. Thanks again and sorry for inconvenience of my first post. Attachments: Posted at 2024-11-01 by @fanoush
not sure what you mean by this but here If the chip can map PSRAM in hardware into the address space just as ordinary RAM then yes it can be used, however the support for PSRAM for STM32 is not there in Espruino. I think PSRAM somehow works only for ESP32 platform because the SDK does it for you automatically. EDIT: Posted at 2024-11-01 by @fanoush And BTW before trying to add PSRAM to STM32 Espruino make sure it even works properly on the chip you plan to use, I've heard bad words about PSRAM on STM32 see e.g. https://dmitry.gr/?r=06.%20Thoughts&proj=11.%20RP2350 4th paragraph "The problem is that properly supporting QSPI PSRAM is hard. ..." - it is for STM32H7 family but it could be similar, so make sure you understand it may not be easy and check errata and look around if someone has it working properly. For ESP32 it took them several hardware revisions of the chip to have it working correctly with PSRAM and initially you have to use their own version of gcc compiler and libraries with specific workarounds for PSRAM so it would not crash in random places. See https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-guides/external-ram.html#chip-revisions for inspiration what can go wrong Posted at 2024-11-07 by Konkery Hi ! Posted at 2024-11-07 by @gfwilliams I think I covered this in my first message? If you can memory map external RAM then great, Espruino should work with it (if you build your own firmware that inits PSRAM first). Espruino can work with external Flash as storage too, it's just slower - and either you need to have memory mapping and to have ensured the flash write command works, or to copy a bunch of code from the nRF52 port to make this work. Posted at 2024-11-07 by Konkery Thanks for the clarification! Posted at 2024-11-08 by @fanoush Yes to all. I think we already said the same thing 3 times in slightly different ways. And each time I fail to see how it could be interpreted in any other way :-) On the other hand none of you explained how do you plan to use the memory, what kind of data will be there. Both external ram and flash will be slower than the internal one so just joining them (or even just using the external one only) will make things to run slower and use more power. As for STM32L496GDISCOVERY when quickly googling psram I just found this unanswered topic https://community.st.com/t5/stm32-mcus-products/stm32l496g-discovery-psram-problem/td-p/355263 and then Zephyr support info for this board https://docs.zephyrproject.org/latest/boards/st/stm32l496g_disco/doc/index.html with psram not supported and then this https://stackoverflow.com/questions/57274543/fmc-slower-than-qspi-on-stm32h7 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2024-10-29 by MarkBloom
Hello!
For out Espruino project we're planning to use STM32 F4 Discovery. However there's one noticable downside - it doesn't have enough memory for what we're planning to do. To compensate that we're going to try to use PSRAM, which is supported by the chip, and external Flash.
My question is: How likely it is, or is possible at all, for Espruino to have memory conflics accessing RAM/PSRAM/Internal flash/External flash? Or to put it simply: are there any known memory issues with described approach?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions