Sign in

username:

password:



Not a member?

Search avrclub



Search tips

Subscribe to avrclub



avrclub by Keywords

AT90S2313 | AT90S8515 | ATMega | ATmega128 | ECL | FETS | IAR | Keyboard | LCD | STK50 | TMOS | UART

Sponsor

controlSUITE™ software
Comprehensive.
Intuitive.
Optimized.

Real-world software for real-time control. Details Here!

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | AVRclub | [AVR club] HELP:ATmega16 sram heap access


Advertise Here

Atmel AVR Microcontroller discussion group.

[AVR club] HELP:ATmega16 sram heap access - pvr_...@ymail.com - Mar 6 9:22:59 2009

HELLO,
I am not able to declare a string in SRAM memory heap. I have refered a project where following instruction was used in C language.

char *header=(char*)malloc(14)

This instruction is used to declare a string of 14 bytes in sram heap. but when compiled in CVAVR this instruction is giving declaration ERROR.
Malloc is used to declare dynamically a string in sram.Pleas help in doing so.
------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )


Re: [AVR club] HELP:ATmega16 sram heap access - Shane Bolton - Mar 6 12:47:51 2009

pvr_3,

I use malloc() all the time and have never had a problem with it.

What is the error message?
What header files (.h) are you including? You need to include

Is the error message coming from the compiler or the linker? If it is
coming from the linker then you need to include libc.a.

Regards,

Shane Bolton
s...@sabworkshop.com

On 07/03/2009, at 1:06 AM, p...@ymail.com wrote:

> HELLO,
> I am not able to declare a string in SRAM memory heap. I have
> refered a project where following instruction was used in C language.
>
> char *header=(char*)malloc(14)
>
> This instruction is used to declare a string of 14 bytes in sram
> heap. but when compiled in CVAVR this instruction is giving
> declaration ERROR.
> Malloc is used to declare dynamically a string in sram.Pleas help in
> doing so.

[Non-text portions of this message have been removed]

------------------------------------



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )

Re: [AVR club] HELP:ATmega16 sram heap access - Pvr Pvr - Mar 9 11:07:48 2009

Hello,

I have included . I am using CVAVR compiler. In HELP I got the fo=
rmat as;=20
=A0=A0=A0=A0 void *malloc(unsigned int size);
So i changed the format to=20
=A0=A0=A0=A0 char *header;
=A0=A0=A0=A0 header=3D(char*)malloc(14);
But still 1 error;
=A0=A0=A0=A0 missing"("
Now i hav switched to array;

I actually need help in programming ATmega 16 to capture image from C3088, =
then forward it=A0to computer for image processing, and then send controlls=
from computer to the Atmega16 to controll wheeled robot. Can you help me i=
n this matter.
Thankyou.

________________________________
From: Shane Bolton
To: a...@yahoogroups.com
Sent: Friday, 6 March, 2009 23:10:46
Subject: Re: [AVR club] HELP:ATmega16 sram heap access
pvr_3,

I use malloc() all the time and have never had a problem with it.

What is the error message?
What header files (.h) are you including? You need to include=20

Is the error message coming from the compiler or the linker? If it is=20
coming from the linker then you need to include libc.a.

Regards,

Shane Bolton
shane@sabworkshop. com

On 07/03/2009, at 1:06 AM, pvr_3@ymail. com wrote:

> HELLO,
> I am not able to declare a string in SRAM memory heap. I have=20
> refered a project where following instruction was used in C language.
>
> char *header=3D(char* )malloc(14)
>
> This instruction is used to declare a string of 14 bytes in sram=20
> heap. but when compiled in CVAVR this instruction is giving=20
> declaration ERROR.
> Malloc is used to declare dynamically a string in sram.Pleas help in=20
> doing so.
>
>=20

[Non-text portions of this message have been removed]

=20=20=20=20=20=20

[Non-text portions of this message have been removed]

------------------------------------



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )