Skip to content

Sync with TUD and update to feather board #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 4, 2024

Conversation

MrKevinWeiss
Copy link

This syncs with all the non-TUD specific changes (ie, anything that isn't 00-*) and updates the target board to the feather-nrf52840-sense,

@MrKevinWeiss
Copy link
Author

Currently I am experiencing an issue with my feather board running 02-timers... It would appear that providing a reset (via make reset or pressing the reset button) while using ZIMER_MSEC actually freezes the program. When plugging and unplugging the USB everything seems to function correctly. This could be related to the cold-start/warm-start problem with saul @MichelRottleuthner experienced. Further investigation is needed.

@mguetschow
Copy link

Just for the record, the commits are taken from https://github.com/netd-tud/WSN-exercises

@mguetschow
Copy link

Currently I am experiencing an issue with my feather board running 02-timers... It would appear that providing a reset (via make reset or pressing the reset button) while using ZIMER_MSEC actually freezes the program. When plugging and unplugging the USB everything seems to function correctly. This could be related to the cold-start/warm-start problem with saul @MichelRottleuthner experienced. Further investigation is needed.

Can confirm this locally: "This is a timers example" is still printed but everything afterwards (blinking led, reporting timeout) doesn't happen.

@MrKevinWeiss
Copy link
Author

Unfortunately I will be available only on Tuesday to look into it. Can we try to offload this task to someone who is not busy? (or who is busy but also knowledgeable @MichelRottleuthner )

@MichelRottleuthner
Copy link

Hmm I tried hard but I could not reproduce the timer hang - not even a single time. I tried with up-to date docker build and also with my local arm-none-eabi-gcc 13.2.0.
As you mentioned SAUL I also tried 04-saul and there indeed one of the board gets stuck without ever printing anything. Warm/cold boot doesn't affect it there. Looking closer I guess we have an issue related to different board revisions 🙄

Adafruit mentions here:

As of January 10, 2024 - We have replaced the discontinued LSM6DS33 with an LSM6DS3TR-C 6 DoF sensor.

We have a few rev. B (black PCB) and now many new rev. C (blue PCB). Unfortunately the accel/gyro sensor was swapped for a different model, which may require further extensions to the lsm6dsxx driver (similar to RIOT-OS/RIOT#20170). Rev. C is the one that gets stuck with 04-saul.

@mguetschow which board revision do you guys have at TUD?

@mguetschow
Copy link

Thanks a lot for looking into this @MichelRottleuthner !

@mguetschow which board revision do you guys have at TUD?

We have black PCBs and I can find a B inside a circle on the lower-left corner of the back side. I guess that means we have rev. B boards, or how else could I find it out?

@mguetschow
Copy link

Hmm I tried hard but I could not reproduce the timer hang - not even a single time. I tried with up-to date docker build and also with my local arm-none-eabi-gcc 13.2.0.

That was a very good hint, I can confirm that it doesn't crash with BUILD_IN_DOCKER=1, but with my locally installed arm-none-eabi-gcc 12.2.1 (Debian user here) it does. Not sure how to go on from here then.

@mguetschow
Copy link

Interestingly enough, I also don't encounter the problem on the oldstable Raspberry Pi OS with arm-none-eabi-gcc 8.3.1.

@MichelRottleuthner
Copy link

We have black PCBs and I can find a B inside a circle on the lower-left corner of the back side. I guess that means we have rev. B boards, or how else could I find it out?

Yes that's exactly how I checked it. The circled letter next to the D2 pin indeed gives you the revision. Perfect. so you have a large amount of rev.B and we have a large amount of rev.C 🤦 😅

@mguetschow
Copy link

This could be related to the cold-start/warm-start problem with saul @MichelRottleuthner experienced.

Could you elaborate what this was/is about? We just encountered an issue with 04-saul not printing anything on warm-start while it works as expected on cold-start. This happens when compiled with arm-none-eabi-gcc 12.2.1, but not in Docker (10.3.1) nor on Raspberry Pi OS oldstable (8.3.1).

So turns out gcc in Docker is actually older than my local one, and we should probably investigate these problems further for the future.

@mguetschow
Copy link

So turns out gcc in Docker is actually older than my local one, and we should probably investigate these problems further for the future.

Although @MichelRottleuthner's 13.2.0 worked for 02-timer at least.

For 04-saul, have you tried flashing the given example that only uses the temperature sensor, or the extended one with accelerometer readings added? Might or not make a difference since I'd guess all SAUL-registered sensors are automatically initialized on boot?

@MichelRottleuthner
Copy link

Could you elaborate what this was/is about? We just encountered an issue with 04-saul not printing anything on warm-start while it works as expected on cold-start. This happens when compiled with arm-none-eabi-gcc 12.2.1, but not in Docker (10.3.1) nor on Raspberry Pi OS oldstable (8.3.1).

We didn't investigate the warm/cold start issue back then as we only got it rarely and was easy to workaround at the time we saw it. The observed symptoms just looked exactly as the behavior as you described. Unfortunately I don't know what caused it and I don't get it on my system.

For 04-saul, have you tried flashing the given example that only uses the temperature sensor, or the extended one with accelerometer readings added? Might or not make a difference since I'd guess all SAUL-registered sensors are automatically initialized on boot?

I used the last commit of this PR (aa8d5d9) without any changes, so no accelerometer code added. But I also think the addition won't make a difference as it will likely already fail during autoinit.

@MrKevinWeiss
Copy link
Author

MrKevinWeiss commented Apr 2, 2024

I also think we make need one of these interactive sync module additions since we always seem to lose the initial output due to the "high_level_stdio" with pyterm...

# Since we are using a high_level_stdio, we may loose the initial output
# from the board. To avoid this, we can use the interactive sync module
# that allows us to tell the application to run
USEMODULE += test_utils_interactive_sync

@MrKevinWeiss
Copy link
Author

Working on task 08 with a current diff of:

diff --git a/08-coap-basic/client.c b/08-coap-basic/client.c
index 06902bb..a6e67ba 100644
--- a/08-coap-basic/client.c
+++ b/08-coap-basic/client.c
@@ -109,7 +109,7 @@ static size_t _send(uint8_t *buf, size_t len, char *addr_str, char *port_str)
         return 0;
     }
 
-    bytes_sent = gcoap_req_send(buf, len, &remote, _resp_handler, NULL);
+    bytes_sent = gcoap_req_send(buf, len, &remote, _resp_handler, NULL, GCOAP_SOCKET_TYPE_UNDEF);
     if (bytes_sent > 0) {
         req_count++;
     }
diff --git a/RIOT b/RIOT
index 833571f..a9b9569 160000
--- a/RIOT
+++ b/RIOT
@@ -1 +1 @@
-Subproject commit 833571f630d8770e1cb216d4f77a75500e945902
+Subproject commit a9b956932d7af293bb0530cff462e447edcf88cd

Only finished task 1 here but seems ok...
There were some gcoap api changes and the most important thing
is the generic feather-nrf52840-sense board useage so we dont
need to worry about which rev
@MrKevinWeiss
Copy link
Author

So just about fully tested, we need some workarounds and probably can fix the root causes later...

@MrKevinWeiss MrKevinWeiss merged commit 028e262 into inetrg:master Apr 4, 2024
@MrKevinWeiss MrKevinWeiss deleted the pr/updatefeather branch April 4, 2024 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants