2016-02-27 07:59 AM
Hi.
I would like to play audio wav (mono, 8kHz, 8 bit) file using DAC. I took 10 sec of some record and converted it to wav file with above parameters. The achieved file is about 70kB.
I made a hex file with an array initialized with the values from file. When I try to compile the project I receive a link error.
What is the technique of loading big arrays into flash and how can I read the array later?
Thanks.
2016-02-27 08:05 AM
1. Toolchian?
2. Why you don't generate *c file with this data ?2016-02-27 08:17 AM
1. Toolchain - IAR EWARM 7.5
2. What is the difference if I genrate c file or h file in this case?2016-02-27 08:30 AM
ad 2. Data must be in *.c file.
in *.h put extern declaration. Search program that generetes c files with data.2016-02-27 10:35 AM
I declared the array in a c file as const uint8_t. In main.c file I declared it as extern uint8_t. The compilation is ok. I have not tested it in hardware yet.
Just for learning purpse - why I cannot declare the same in the header file? Everything that is included in a header file appeares in the place of header file definition. Right?2016-02-27 10:54 AM
Becase each time that you include this h file, this table will be created in memory.
But first you will get error on double declaration.