2017-09-16 08:11 AM
Greetings,
I need to upload an audio file containing an ECG signal to my stm32f446 nucleo-64 board, this file will be a .wav file or a simplified version of the .wav file containing interleaved audio samples from two channels. Since the .wav file or the samples file is too large, it is possible to upload it to the internal fash memory, using mbed? Or I need another software tool?
Note: this post was migrated and contained many threaded conversations, some content may be missing.2017-09-16 08:19 AM
Tell the ST-LINK Utilities it is a binary file and write it directly into memory at the address you want to store it.
Too large for what?
2017-09-16 11:50 AM
The file is too large to store in RAM. It has about 256 kB.
I don't know how to use the ST-Link utilities, I can do that using mbed? How?
Sorry, I don't know much about this platform.
2017-09-17 06:43 AM
you could try converting it to a .h header file and just ♯ include it. declare it const and let the linker do what linkers do.
2017-09-19 04:01 PM
I could do that, but I want to be able to change the file or files stored without changing the code.
2017-09-19 04:17 PM
I could provide a link the the ST-LINK Utilities Manual if that would help. It is a fairly trivial task to load binary data and push it to a specific address within the processors' flash memory space.
mbed allows you to drop a binary, but I don't think it allows you to control the address at which it is placed, and I don't think it takes .HEX files. Review the documentation for your chosen tools.
2017-09-19 04:28 PM
Yes I think the ST-Link Utilities Manual link would help.
It's possible to convert a hexadecimal file to binary? If it's not possible, what I can use instead of mbed?
2017-09-19 05:46 PM
Your data is already in a binary form.
A .HEX file can be translated with tools like S-Records, or HEX2BIN, or frankly loaded into a programming tool and saved back out in a different format.
If you have an .AXF or .ELF file Keil's FromELF tool can generate .BIN or .HEX files.
In the context of mbed creating a binary file from a .HEX loses the inferred address of the data, and mbed will presumably blow away your application code at 0x08000000, which is not what you want. You want to put your data deeper into flash from where you application can access it. For a 512K device, and 256K of data, perhaps 0x08040000 should be the base for the data.
Don't let 'STM32' specifics limit you understanding here, micro-processors/controllers all have similar construction and compilers, assemblers and linkers have common functionality. Techniques and specifics may vary slightly, but a basic understanding is transferable.
2017-09-21 12:46 PM
Thank you very much for your help,
Do you know which library and functions (can you give me an example) can be used to store arrays/variables in STM32 flash memory?