Closed Candas1 closed 1 year ago
It looks like a fixed 2K size stack is used for GD32s ?
Yes,
stack_size = DEFINED(__stack_size) ? stack_size : 2K;
Okay, good point about low-RAM chips, though.. I'm wondering if anything useful can be done with them in the Arduino framework with such low resources :( You might need SPL to get less overhead.
I am actually porting this code you know from SPL to arduino lol I am exploring, didn't think Arduino would have that overhead.
I will just use a custom ldscript in platformio.ini with parameter board_build.ldscript and a reduce stack size to something like 1K and see where I am getting.
There are hoverboard splitboards with those chips, they somehow managed to fit in motor control and reading data from an IMU.
I've adapted the generator script to only use 512 bytes of RAM for every chip that has 4K or less RAM.
https://github.com/CommunityGD32Cores/platform-gd32/commit/3424e663a97445312855c8b8b5ac25f55ebf0577 https://github.com/CommunityGD32Cores/ArduinoCore-GD32/commit/d0cf8578ca720b778dc1acd4b56094e580d0bf2b
Thanks a lot!!! Much appreciated
Hi,
Thanks again for this project. I am testing same arduino code on similar boards with STM32F103C8 and GD12F130C6 chips. As I am adding more code/features, I am getting this message on the GD32 board:![image](https://github.com/CommunityGD32Cores/ArduinoCore-GD32/assets/20670049/41955b7a-20b3-4731-a71d-412414d75658)
Then I commented out some of the code, and I see this usage on the GD32:
And this usage on the STM32:
![image](https://github.com/CommunityGD32Cores/ArduinoCore-GD32/assets/20670049/02506bac-f987-4165-b52e-00a23cbe38ab)
It looks like a fixed 2K size stack is used for GD32s ? It seems on the STM32 they use a minimum size for the stack and heap in the ldscript.
It's probably not a big problem on chips having a lot of ram, but this GD32 has only 4K of ram unfortunately.