solettaproject / soletta-small-oses-samples

Soletta samples for Small OSes
Apache License 2.0
1 stars 3 forks source link

samr21-xpro: HARD FAULT HANDLER #3

Open biboc opened 8 years ago

biboc commented 8 years ago

I ran a coap-client on a samr21 and a coap-server on another samr21. I pushed SW0 (samr21 xplained pro board) and I get:

(h:17 m:12 s:24) main(): This is RIOT! (Version: 2016.03-devel-615-ga6fae-ubuntu)
(h:17 m:12 s:24) Found 1 links
(h:17 m:12 s:24) Link #0
(h:17 m:12 s:24)    Addr #0: ff02::1
(h:17 m:12 s:24)    Addr #1: fe80::585a:427a:aa65:1ef6
(h:17 m:12 s:46) *** RIOT kernel panic:
(h:17 m:12 s:46) HARD FAULT HANDLER
(h:17 m:12 s:46) 
(h:17 m:12 s:46) *** rebooting...
(h:17 m:12 s:46) �main(): This is RIOT! (Version: 2016.03-devel-615-ga6fae-ubuntu)
(h:17 m:12 s:46) Found 1 links
(h:17 m:12 s:46) Link #0
(h:17 m:12 s:46)    Addr #0: ff02::1
(h:17 m:12 s:46)    Addr #1: fe80::585a:427a:aa65:1ef6

Ok I managed to get the light resource once but I can't do it again, it keeps doing that (above) How enable more logs? I tried to export SOL_LOG_LEVEL="DEBUG" before compiling but no more logs

ibriano commented 8 years ago

On Wed, 24 Feb 2016 08:16:07 -0800, bapclenet wrote:

I ran a coap-client on a samr21 and a coap-server on another samr21. I pushed SW0 (samr21 xplained pro board) and I get:

(h:17 m:12 s:24) main(): This is RIOT! (Version: 2016.03-devel-615-ga6fae-ubuntu)
(h:17 m:12 s:24) Found 1 links
(h:17 m:12 s:24) Link #0
(h:17 m:12 s:24)  Addr #0: ff02::1
(h:17 m:12 s:24)  Addr #1: fe80::585a:427a:aa65:1ef6
(h:17 m:12 s:46) *** RIOT kernel panic:
(h:17 m:12 s:46) HARD FAULT HANDLER
(h:17 m:12 s:46) 
(h:17 m:12 s:46) *** rebooting...
(h:17 m:12 s:46) �main(): This is RIOT! (Version: 2016.03-devel-615-ga6fae-ubuntu)
(h:17 m:12 s:46) Found 1 links
(h:17 m:12 s:46) Link #0
(h:17 m:12 s:46)  Addr #0: ff02::1
(h:17 m:12 s:46)  Addr #1: fe80::585a:427a:aa65:1ef6

Ok I managed to get the light resource once but I can't do it again How enable more logs? I tried to export SOL_LOG_LEVEL="DEBUG" before compiling but no more logs

It seems we don't have a configuration variable for that, and RIOT won't use environment variables. You can add sol_log_set_level(4); a the beginning of the startup function.

I'd also advise to add "CFLAGS += -DDEVEL_HELP" to the Maefile under targets/riot (I don't know why I didn't do it by default), so you can at least see where it's crashing.

biboc commented 8 years ago

I set level to 4 and develhelp but I don't get anymore output.

Which behaviour should I expect for the client and the server?

ibriano commented 8 years ago

On Wed, 24 Feb 2016 09:27:55 -0800, bapclenet wrote:

I set level to 4 and develhelp but I don't get anymore output.

Which behaviour should I expect for the client and the server?

Yup, that works if called before sol_init(), which has already been called by the time it reaches startup(). Another item to the TODO list.

Best choice, in any case, is to enable DEVEL_HELP for RIOT so you can debug it properly. Might want to add BUILD_TYPE_DEBUG=y as well to sol_samr21-xpro.conf

biboc commented 8 years ago

Ok, I added everything and same result. Does it work on your boards?

ibriano commented 8 years ago

On Wed, 24 Feb 2016 09:53:03 -0800, bapclenet wrote:

Ok, I added everything and same result. Does it work on your boards?

It was working last time I tried it, but I don't have the boards right now. There is a problem in the way our CoAP handles sending notifications to observing clients, some times it ends up without memory to duplicate packets and it fails, but the test wasn't crashing and after leaving it sit for a little while, resources would be available again and notifications go back to working. We are working on that and other things on the CoAP implementation, so things should improve in the near future.

As soon as I can test the samples again, I will, and if I find anything wrong, I'll try to fix it.

Something to keep in mind after adding the CFLAGS to RIOT is that you'll need a full build of it, or the objects it has already won't be recompiled. It would be helpful to see where it says it's crashing.

ibriano commented 8 years ago

On Wed, 24 Feb 2016 09:53:03 -0800, bapclenet wrote:

Ok, I added everything and same result. Does it work on your boards?

Also, the right thing for RIOT is CFLAGS += -DDEVELHELP

glima commented 8 years ago

Hi, @bapclenet. As a heads up, the memory (fragmentation) problem WRT CoAP usage on RIOT should now be fixed. Have you had the chance to experiment after that?

Cheers.