My project works fine in SES 5.70a, but I want to migrate to SES 7.32
When first opening the project and attempting to build, I got this error
7> SEGGER_RTT_Syscalls_SES.c:73:22: error: unknown type name ‘__printf_tag_ptr’ 7> 73 | int __putchar(int x, __printf_tag_ptr ctx) { 7> | ^~~~~~~~~~~~~~~~ 7> Build failed
To resolve it I did this:
Removes these file from the project
SEGGER_RTT.c SEGGER_RTT.h SEGGER_RTT_Conf.h SEGGER_RTT_Syscalls_SES.c
Then:
- Under 'Solution->Options->Common->Private Configurations->Library' changed 'Library I/O' to 'RTT'
- Make sure the 'Debug' and 'Release' configurations inherits the same value
- 'Preprocessor'->'Preprocessor Definitions'
- Changed 'RETARGET_ENABLED=1' to 'RETARGET_ENABLED=0'
- Clicked OK and rebuilt the project.
I came to this solution after reading this:
devzone.nordicsemi.com/.../unknown-type-name-__printf_tag_ptr-retarget-c, devzone.nordicsemi.com/.../nrf5-sdk-17-1-0-examples-is-not-compiling-in-latest-ses-6-20a and wiki.segger.com/Embedded_Studio_Library_IO
Now the project builds and we come the the actual problem: the library heap is not functioning:
Added the following
int main() { void * test = malloc(1); printf("%p\n", test); //.. rest of main()
Run the code on a nRF52840 target (like a devkit)
Observed how the printf prints `00000000` indicating the malloc() failed. The same code works with Segger 5.70a
Checked the heap size in project options. It is set to 1024. Confirmed in the map file that the `.heap` symbol is size 0x400
We are using nRF SDK version 15.2.0 with S140 SoftDevice v6.1.0