Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


DPSRAM use with freeRTOS

Posted by gatolen on July 5, 2017

Hi , Getting to know freeRTOS better really enjoying using it. I have a training program using a PIC24FJ64GB002 which has a 16 FIFO ADC buffer. I used the FIFO to gather 16 samples then averaging them. Using the info to control servos. I wanted to learn DMA so I moved to the PIC24HJ128GP502 with DMA. The ADC in the 24HJ has just one ADCxBUF so the DMA MOD uses the near memory for its buffer. I adapted the P24FJ files to my working PIC24HJ F file. When I try to build the PIC24HJ I have the new error saying .bss.section no memory for my data. I reduce the heap and I can build my file. I think this is due to the DMA BUFFER. I tried declaring my other two global char arrays which are used for other things, char myarray[] attribute ((far)) , which compiles fine. My question is using the attribute this way allowed and does this then put these arrays in the far mem location. Didn't see any examples showing this. Can I use some other heap functions (heap 4 maybe) to give me more flexibility to my memory? I have room in my program space visibility for data if I understand it correctly that canbe used. Well anyway freeRTOS seems great and when I get more understanding I'll make another donation. Thank you guys so much for making freeRTOS for people like me.

DPSRAM use with freeRTOS

Posted by rtel on July 5, 2017

I'm afraid I don't know what the far attribute does using that compiler, so would have to look it up myself. You should be able to look in the map file output by the compiler to see where the allocation ended up though.

heap_5 is the most flexible.

DPSRAM use with freeRTOS

Posted by gatolen on July 8, 2017

Thanks for your reply. Let me ask you this question, when I am getting close to running out of data memory is there a way with my chip that freeRTOS could use a section of program memory or could I remap program memory myself? This is an area I certainly have not any experience in I would just use the partitions that were currently on the chip. It seems very interesting if I could do this. This is probably a question more for the microchip people. I was able to get my program to run now by changing the amount of heap I set in the freeRTOS config file but I know I must be right at that limit. I'll use the get heap high water mark and see how close I am. I'll study on how to extend if possible my memory. Thank you for your grt rtos.

DPSRAM use with freeRTOS

Posted by richarddamon on July 8, 2017

On the Pic24F series, the Program Memory is Flash, so not really equivalent to data memory. If you have a large amount of read only data, marking it const and telling the compiler to use program memory for it can save data memory (note, you can't take the address of such an object and get a normal data pointer, so you may need to make some adaptations to your code.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers





STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner