This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Porting to RTX5/CMSIS RTOS2, memory footprint

I've inherited a project for a NXP LPC11C24, written for MDKv4 and RTX which I've mostly been maintaining for minor tweaks and bugfixes. More recently I've been tasked with making significant changes to add needed features.

I've been concerned with the obsolescence of the project when working with recent versions of µVision and I decided that I had a reasonable opportunity to port it to RTX5 and CMSIS-RTOS2. As it turned out, the code changes weren't that extensive, that's the good news.

Unfortunately, the resulting code is not usable on the MCU -- nor is the most basic "empty" compiled program, with nothing but a main function containing a while(1). After building each, I get the following summaries:

  • Old project: Program Size: Code=14256 RO-data=268 RW-data=176 ZI-data=7000
  • New project: Program Size: Code=7752 RO-data=504 RW-data=168 ZI-data=34792
  • Empty RTX5/CMSIS-RTOS2 project: Program Size: Code=5484 RO-data=504 RW-data=164 ZI-data=34748

Code size is surprisingly quite a bit smaller for the CMSIS-RTOS2 version; I was more surprised however to find the significant increase in memory consumption. The LPC11C24 provides 8K of SRAM. After creating a project, selecting the chip and startup code, the OS core and API, no additional hardware feature support or driver code, and adding an empty main function, I get a program that consumes four times that much memory. (I had to provide invalid values for read/write memory for the build to finish at all.)

First, I'm no expert, and I imagine there's a good chance I've done something wrong, or skipped some important steps. If there are any obvious or common things to check for, I'd be thankful for suggestions.

Beyond that though ... I've done a bit of searching, and I haven't found any clear documentation, app notes or other resources that might have warned me of such a huge memory overhead increase implied by CMSIS-RTOS2 and RTX5 relative to older RTX based code, and the resulting reduced set of choices for MCU platforms for which new projects can be developed. Can someone point me to what I missed?

What options are there for developing for this MCU (which for the foreseeable future we're stuck with) using µVision?  I'm starting to contemplate re-writing the lot of it as bare-metal code, a somewhat daunting prospect for this project.

Parents
  • Luckily, it does look like it's something obvious I missed -- the global memory pool allocator, configurable in RTX_Config.h.

    I still don't fully understand the apparent overhead beyond the value selected in OS_DYNAMIC_MEM_SIZE, but I'm able to move forward again.

Reply
  • Luckily, it does look like it's something obvious I missed -- the global memory pool allocator, configurable in RTX_Config.h.

    I still don't fully understand the apparent overhead beyond the value selected in OS_DYNAMIC_MEM_SIZE, but I'm able to move forward again.

Children
No data