PCM/Wav data via flash

Hi All,

I need to use some wav/pcm data files in an application and ideally want to be able to store the files in flash as we have a requirement for being able to update the files over usb.

I was wondering if there is an example that's shows flash usage for app data?  Also was wondering if there is a wav/pcm api already included before I reinvent the wheel!

Thanks,

Mark



made clear
[edited by: mark@bytecrew.com at 11:16 AM (GMT -4) on 22 Mar 2021]
  • 0
    •  Analog Employees 
    on Mar 23, 2021 4:54 PM

    Hi Mark,

    We don't ship any examples showing how to get app data into flash but let me see if we have any reference code around internally. There may be a few steps to the process but I think I can get something together. So initially you will write the data files to flash the first time using our cldp is what it sounds like and then in the future you will change the data through USB? I assume that as you are completing this project the entire application will be stored in flash so you want to be sure that the data files are far enough away from the application that they won't get trampled as the application increases in size. I want to make sure I understand things correctly so I can help you as much as possible.

    Unfortunately there is no wav/pcm api included.

    Regards,

    Chad

  • Hi Chad,

    Thanks for the reply. I want to be able to have say for instance 4 slots in the flash for wav data that will ship with the app.  I would also like to be able to have another bunch of slots for user data which can be accessed via usb.  Yes, the app will also be stored in flash so I will have to keep the app and data from stepping over each other.  I have used 4 as an arbitrary number as the number will mostly depend on the size of the app and how much flash is remaining.

    I will do some digging around cldp and see what that offers.  I am trying to avoid having the data files included as part of the app as keeping them separate will provide a lot more flexibility.

    Any help is greatly appreciated Slight smile

    Thanks,

    Mark

  • 0
    •  Analog Employees 
    on Mar 24, 2021 7:44 PM in reply to mark@bytecrew.com

    It actually might work better if you want to keep the files separate. If you could convert the files to binary or ascii you can use the cldp(C:\Analog Devices\CrossCore Embedded Studio 2.9.4\cldp.exe) to program them to whatever address of flash you want with a command line similar to this:

    cldp.exe -proc ADSP-SC589 -core 1 -emu 1000 -driver "C:\Analog Devices\SAM_BareMetal_SDK-Rel2.1.1\extras\flash-programmer\Supporting_Files\sam_dpia_Core1.dxe" -cmd prog -erase affected -format bin -offset 0x20000 -file "file.bin"

    You can get a sense of the flash sector map by using the following command:

    cldp.exe -proc ADSP-SC589 -core 1 -emu 1000 -driver "C:\Analog Devices\SAM_BareMetal_SDK-Rel2.1.1\extras\flash-programmer\Supporting_Files\sam_dpia_Core1.dxe" -cmd view

  • Thanks for the command lines, very useful Slight smile

    Is there a manual for cldp?  Im looking through the examples provided with CrossCore to get some idea of the flash api for reading the data once its in there.

  • 0
    •  Analog Employees 
    on Mar 26, 2021 3:16 PM in reply to mark@bytecrew.com

    There is online help in CCES for the cldp if you search either cldp or command line device programmer.

    As far as examples there are a lot and unfortunately they don't all stay consistent with the approach. The cldp uses a driver that knows how to communicate with the flash chip and the source for that can be found in C:\Analog Devices\SAM_BareMetal_SDK-Rel2.1.1\extras\flash-programmer\Device_Programmer_Sources. You would only need a subset of this code but it should give you the example source you need.

    Thanks,

    Chad