Several warnings while compiling and uploading

I have written some code for a Sodaq One rev4 board based on the Sodaq libraries and every time I compile I get several warnings;

“ld.exe: warning: changing start of section .bss by 4 bytes”

And when I try to upload the code to my device I get a “SAM-BA operation failed”. The board seems to be working with the code (though it does not go to proper sleep mode, the power usage stays at 7 mAmp). Doesnt matter how often I retry the download, the warnings stay.

First question; should I be worried about the warnings?

Second question: Could these warnings be related to the board not entering proper sleep mode?

I use the code supplied here on the forum;
Sleep code GPS;
digitalWrite(GPS_ENABLE, LOW);

Sleep code LoRa;

Sleep code LSM303
lsm303.writeReg(LSM303::CTRL1, 0);
lsm303.writeReg(LSM303::CTRL5, 0);
lsm303.writeReg(LSM303::CTRL7, 0b00000010);

Sketch uses 31,552 bytes (12%) of program storage space. Maximum is 262,144 bytes.
Atmel SMART device 0x10010005 found
Device : ATSAMD21G18A
Chip ID : 10010005
Version : v2.0 [Arduino:XYZ] May 9 2016 16:06:46
Address : 8192
Pages : 3968
Page Size : 64 bytes
Total Size : 248KB
Planes : 1
Lock Regions : 16
Locked : none
Security : false
Boot Flash : true
BOD : true
BOR : true
Erase flash
done in 0.822 seconds

Write 31900 bytes to flash (499 pages)

[=== ] 12% (64/499 pages)
[======= ] 25% (128/499 pages)
[=========== ] 38% (192/499 pages)
[=============== ] 51% (256/499 pages)
[=================== ] 64% (320/499 pages)
[======================= ] 76% (384/499 pages)
SAM-BA operation failed
An error occurred while uploading the sketch

[========================== ] 89% (448/499 pages)
[==============================] 100% (499/499 pages)
done in 0.205 seconds

Verify 31900 bytes of flash with checksum.
Verify successful
done in 0.037 seconds
CPU reset.

Just puts the RN2483/RN2903 into sleep mode.

The main SAMD21 MCU uses about 7mAs while not in sleep mode.
Other code is required to put the MCU into sleep mode.

Hi Gabriel, I guess that would be the following code:


__WFI(); // SAMD

I also use that. But for some reason my board doesn’t want to go to deep sleep mode.

There does also seem to be some issue during the upload.

If the upload isn’t completing correctly, that will like result in a range of other issues.

Do you have an idea what could be causing that? I get that error no matter what code I use, even your demo code (low power mode) that only has 25 lines of code. I have already tried to change to a different USB port on my laptop (Lenovo T440p) but that doesn’t help.

The errors seem to indicate some interruption or failure during the process of writing the code to the flash memory. This might indicate some hardware issue.

I would recommend, if possible, that you try the device on another computer with a different USB cable. This would eliminate the possibility of any non-device hardware issues.

Unfortunately, another cable and another laptop does not help. My collegue has the same messages when uploading to the Sodaq One boards (we have several and we get those messages with all boards). We use IDE version 1.6.13 and 1.6.9 of the board package.

What I can try is to download the application using a normal PC. Maybe that helps.

I compiled and downloaded the same software into the same board using a PC and now I don’t get the SAM-BA error and also no message that there was an error while uploading. So it seems to be related to the use of a laptop.