This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How do I load a data file (.wav) into Arm Hercules Flash with CCS?

I have a requirement to load a windows audio file (.wav) file into the FLASH of a Hercules micro controller.

I have allocated a Memory area to do this.

MEMORY

{

FLASH1    (RX) : origin=0x000A0000 length=0x00060000

}

The compiler reports an error with the .wav file.

 

SECTIONS

{

..

   wavFile:

   {

            wavfile = .;

            Bell.wav

   } > FLASH1

}

Please advise how I can load an external data file into the FLASH of the controller.

 Rob

  • There is no feature of the compiler tools which performs this task.

    You need to employ some external utility which converts the .wav file into a C array like this ...

    /* Converted from something.wav */
    unsigned short audio_samples[] = {
    0x1234,
    0x5678,
    /* and so on */
    };

    Then add this C file to your project.

    I understand Matlab and Python have some features that may be helpful.

    Thanks and regards,

    -George