Hi there, could someone please point out where I’m going wrong?
I’m trying to edit the default settings of the firmware but I’m rather new to all of this stuff. I have tried editing the variables in the main.c file from AudioMoth-Firmware-Basic, then replacing the main.c file of AudioMoth-Project with it, and then building this entire project using the Simplicity IDE. Then I use the .bin file located within the ‘GNU ARM v4.9.3 Release’ directory to flash the firmware of the device. This however results in the device being bricked and requires me to reinstall the regular firmware. What am I doing wrong?
Thanks in advance!
I'm using Windows 10.
The newer firmware that supports exFAT SD cards is bigger and seems to show up the unreliability of communication with the bootloader. We have a new version of the flash tool with a GUI coming out shortly which should be a bit more reliable. What operating system are you using? I'll see if I can slow down the current flash tool and whether that makes any difference.
Hi Alex, thanks for your explanation! I think I got it working now. The problem was indeed just when flashing the firmware, while the .bin file was fine. With bricking I meant that I got the error "ERROR: Timed out waiting for send confirmation from AudioMoth", combined with the device not responding to anything (switch or USB) until I put it in programming mode and flashed it again. This still happens quite often when I'm trying to flash, but it does flash correctly sometimes (with help of flash -i port) so I can work with that. Might the error be due to the cable I'm using or something? In any case, my problem is solved so thanks a lot!
1) Yes, you should change the values within defaultConfigSettings.
2) These settings are separate from the defaults in the Configuration App and are what the AudioMoth will do in the absence of any configuration - if you switch immediately to 'DEFAULT' without setting the time. The entire configSettings_t data structure is replaced with whatever the configuration app sends to the device so none of these default settings are preserved after configuration..
Can you post the changes that you are making? When you say it is bricking the AudioMoth, what actually happens?
Thank you. I'm able to get the unedited main.c file to flash now. Two follow-up questions: 1) is it correct that I should edit the defaultConfigSettings under /* USB configuration data structure */ if I want to change the default settings? Because that's what I've tried but it keeps bricking the device. 2) Why don't some of those default values seem to match up with those shown in the Configuration App? For example, .sleepDuration = 0 and .recordDuration = 60, while those are respectively 5 and 10 seconds in the App. Are these converted someplace else?
Hi Alex, thank you very much for your response. I have now tested both the unedited main.c files from the Audiomoth-Firmware-Basic and Audiomoth-Project directories. In both cases, I get no orange highlighted errors, but I do see"[post-build] Error 1 (ignored)" at the bottom of the console. In the first case, the output file is 116 kB and the .hex files indeed starts with :10400000. When using the main.c from AudioMoth-Project, the output file is 20 kB and strangely, there is no .hex file as output. In both cases, the error I get when flashing is this: "ERROR: Timed out waiting for send confirmation from AudioMoth".
Hi Yannick, That's the correct process. Does the AudioMoth-Project build correctly before you make any changes? This code should make the AudioMoth respond to the Time App when in USB/OFF and just blink the LED when the switch is in DEFAULT or CUSTOM mode.
Are there any warnings in the console when you compile with the modified main.c file? They will appear as highlighted orange lines in the code. They can scroll past quickly and are sometimes hard to spot.
Can you confirm how big the resulting binary file is. Also, if you open the .hex file that appears in the same Release folder can you confirm that the first line starts with ':10400000'.
Alex