Quality RTOS & Embedded Software

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


Loading

malloc for a pointer.

Posted by Nobody/Anonymous on December 10, 2005
Hello,
I am debugging an application who run on FreeRTOS ported on ADuC7026, using Heap_2 as memory management.(Using KEIL Debugger)
I allocate memory for a pointer:
uint8 *mem_to_send = PanicNull(prvPortMalloc(sizeof(uint8)));
So the allocated memory will be on the Heap.

My Problem is that the debugger signalize a Address violation error:
*** error 65: access violation at 0x00000000 : no 'write' permission
when he execute the instruction :
mem_to_send[0]=0xC0;
so that it seam like my pointer is not initialized
Please can you explain me what is going on ? Generally, how to allocate memory to someting other than a task.
Best regards;
Emeric

RE: malloc for a pointer.

Posted by Nobody/Anonymous on December 10, 2005
I presume PanicNull() will tell you if the pointer is NULL.

Check that portBYTE_ALIGNMENT is set correctly in your port (ADu is not official port?).

You say you are allocating memory for a pointer, but use sizeof( uint8), which is presumably 8bits. Most likely a pointer is 32bits. Should this be (uint8*).

RE: malloc for a pointer.

Posted by Nobody/Anonymous on December 11, 2005
portBYTE_ALIGNMENT is set to 4. I thing this is normal. You are wrigth, i have to use (uint8*).
I ported Aduc using LPC2106 as starting point. The only thing i have changed are the timers and interrupt service routine which are specific to ADUC.

I donĀ“t really know where my problem com from.

Any ideas?
best regards


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




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

Latest News

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

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