‎2021-03-24 08:27 AM
I have to know if the file will stay into the mcu memory in this way and if the c program will work or if this idea il wrong and i cant do in this way.
‎2021-03-24 08:38 AM
Hard to say I'm clear on the detail here. Depending on what exactly you're trying to achieve this could get fairly complicated.
Dropping files, probably want to use a USB MSC or MTP device, with some storage and FatFs. Do you have external flash, eMMC or microSD in your implementation.
FatFs provides f_open, f_read equivalents to fopen, fread on typical C w/OS platforms.
Serial you could use a terminal, or X-Modem to transfer a configuration file.
With Host side application you could hide a lot of the detail.
‎2021-03-24 08:42 AM
"drag the file i the .txt file into the mcu like for programing one"
When you program a microcontroller by drag & drop like that, you are actually "dropping" onto the programmer/debugger - not the Target microcontroller itself.
The programmer/debugger then takes the "dropped" file, and programs it into the Target microcontroller via the SWD (or JTAG) interface.
So the Target microcontroller never actually "sees" the dropped file.
"the file will stay into the mcu memory in this way"
The file itself is never in the Target MCU's memory.
If you are doing this on a Discovery or Nucleo board - where the programmer/debugger will stay attached - there is a way for the Target MCU to access the file
‎2021-03-24 08:45 AM
i forgot that, i'm an idiot :face_with_tears_of_joy:
‎2021-03-24 08:47 AM
I saw that is possible using a SSD driver and specific functions to drive it by serial port. Could i load the txt file on an ssd and than the MCU could access to the txt by serial port. Is this a good solution?
‎2021-03-24 08:53 AM
Surely, an SD-Card would be far simpler?
Or USB stick - if your Target can do USB Host.
You realise you can simply copy a file to a COM port on the command line ... ?
Took a while to find - this is how the Target MCU can access the ST-Link's "dropped" files:
https://os.mbed.com/handbook/How-mbed-works#how-the-localfilesystem-works