Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists