I am using an adafruit-nrf52-pro-feather (nrf52832) to run my project of detecting voice by this below scenario:
++ Setting up:
[PC] ==== USB cable =====[Adafruit] * * * BLE * * * [Phone]
+ Audio files are very small size (less than 100kB or 20 seconds), with ADPCM format
+ USB cable which is delivered together with the board, but currently I am using as UART port for monitoring serial log.
I still have some concerns for this scenario as:
1) For transferring audio files from PC to the Adafruit, what are the available approaches ?
Is there any way to use the same USB cable and still have UART port debugging normally?
2) I suppose the received audio files would stay in RAM by default, but is Ada RAM enough for the above size?
3) Can I send the file (in RAM) directly via BLE or I need to do somethings else before sending via BLE?
I appreciate any suggestions/helps or some reference links.
Thanks Einar Thorsrud for commenting.
I want to transfer the audio file at one time, as I think it's not big. May be I will split it up by chunks as you said if there is no way to compress it smaller.
From the SDK 14.1 I can't search out some examples to proceed with tranferring a very small file to test it.
You may of course be able to compress it, but that depend on your project. As you have a PC in one end then I assume it is easier to compress on that side, and do the decompression on the phone? You can compress audio on the nRF as well, but it may not be as efficient due to the relatively slow CPU (at least if you want to compress the audio real time). If you want to do audio compression on the nRF side, then you could for example consider the Opus codec.
The input requirement for my phone's apps is ADPCM format. Yes you are right, I will make the compress on the PC could do it faster and easier than the nRF.
Now I need some information about duplexing both UART applications as your suggestion. In worst case I would think about putting the file into SD card and read from there.
I see. I do not have any more specific suggestions about UART duplexing, but I think both alternatives should be fairly simple to implement on both sides. You probably want to avoid the logger module in the SDK though, and handle the UART communication yourself, using only the UART driver.
I appreciate your kind comments.
In case of I have to use SD card, I can only see some simple examples but without pin connection or how to set up the ports:
Also the flash data storage implementation is experimental without pin connection/HW configuration description.
The SDK has a SD card example which demonstrates how to read and write data to an SD car with FatFs. The flash data storage module on the other hand is only intended for using internal flash. (You should not put much emphasis on it being experimental though, as it is used extensively by other modules, such as the peer manager).
Hi Einar Thorsrud,
I see, it's clear description enough now.
Thanks for your kind help.