2025-09-16 12:21 AM - last edited on 2025-09-16 1:34 AM by Andrew Neil
2025-09-16 1:26 AM
1. No big difference but probably RAM configuration is closer to what you want to achieve because of data section handling. You need to define your DRAM memory area and then assign some (almost all) sections to it. It may be a good idea to use internal RAM for .data section.
2. In a properly written program stack should be relatively small, no more than few KiB, so put in in on-chip RAM for faster access. If the heap is used, then it's probably big, so put it in DRAM. After you get the basic setup working, you should think about moving some critical parts of code, esp. ISRs to on-chip RAM. If you don't modify the linker scrip too heavily, the vector table will be correctly placed at the start of memory, so no alignment problems here.
3. VTOR may be set by the bootloader or the app - no big difference. In my code I always initialize it in the bootloader.
4. If the memory interface is initialized by the bootloader, replace the app's SystemInit with you own, empty implementation. Also, remove any CubeMX-generated clock initialization functions from the app code. startup.s should only be modified if you want to use both internal RAM and external DRAM, which is probably the case in any reasonable project. You don't need to modify it if you use only DRAM, so maybe start with this configuration and upgrade later.