2021-08-25 01:14 AM
When I use the 51 kernels, if I encounter too many defined variables, especially when there are more arrays, I can use xdata,idata to define variables, but I don't know if I can use them with STM32?
Solved! Go to Solution.
2021-08-25 02:15 AM
The 8051 core was developed in the late 1970s, uses several address spaces due to core limitations and is therefore not comparable to modern microcontrollers.
With STM32 you can address the entire available RAM and place variables there; you no longer have to define memory types such as XDATA or IDATA - they are unknown to the compiler anyway.
Regards
/Peter
2021-08-25 02:15 AM
The 8051 core was developed in the late 1970s, uses several address spaces due to core limitations and is therefore not comparable to modern microcontrollers.
With STM32 you can address the entire available RAM and place variables there; you no longer have to define memory types such as XDATA or IDATA - they are unknown to the compiler anyway.
Regards
/Peter
2021-08-25 06:39 PM
Thank you very much!
2021-08-25 09:06 PM
The 32-bit address space is 4GB, that's not fully populated, but the code and data sections tend to be large linear regions.
The linker script can define and name sections of memory, and you can use __attribute__ to use them, as appropriate.
The demaractions here tend to be for internal/external memories, or the distance from the core.
College level texts on 32-bit architectures might be worth review as these things can be significantly more complex than old 8-bit architectures.
Peripherals are mapped within the same 4GB address space, as memories. Access to peripherals is typically done through structures as the multiple instances tend to be a step-and-repeat implementation.