Our new industrial device is based on version 8.2.0, used target is PIC24EP512GU810. This target has 2 types of memory, near(Address 0x0000 - 0x7FFF) and EDS(0x7FFF ->…). For all the used tasks we need 8K RAM for RTOS task stack i features. The access to both memory regions is different and requires different pointer type and access approach. Due to used many libraries (file i/o, Graphics, ethernet, bootloader…) The near memory is full and the linker cannot solve the build due to not enough memory and still we have 45% free space (in the EDS region). The problem is, that moving some firmware module to EDS memory requires source code modification, and most of the librarys contains source code, which is automatically generated and cannot be touched by hand, due to override when next compile (examle is the graphics screens and widgets, generated by PC application).
** Due to most of the memory used is by the RTOS, we need to move the entire module to the EDS memory in order to free near memory.** I still struggle to manualy rewrite all the pointers, function types and parameters, pointer castings defines, typedefs. I managed to reach successfull compilation but still cannot start the scheduler successfully and receive address and stack error traps.
** My question is how we can move the entire RTOS to the EDS space (i suggest there is short cut scenario), and if there is no short cut, i need recomendation of good approach to manually rewite step by step**. In spite of all efforts i doubt of success, due to some functions use pointers to global objects(EDS) and local objects (suppose EDS but may be near because of the linker setting to keep the stack in the near memory)
We missed the release of the device and already have alpha series of 30pcs in field. If we can manage with your help to solve this issue, we will release them now, otherwise we will need to migrate to PIC32MX, which will make big impact for the other libraries migration.
Used target: PIC24EP512GU810 Used compiler: XC16 1.21 PRO Optimization level: "s" RTOS version: 8.2.0 Thank you in advance for your support and efforts Kind regards Dimitar Belev