[riot-notifications] [RIOT-OS/RIOT] Cannot assign a pointer in ISR (#16517)

Jean Pierre Dudey notifications at github.com
Tue Jun 1 10:29:27 CEST 2021


It fails here:

```c
        /* Where the error is 
          * If I delete this,  
          * the program works fine */
	ptr->next = &dev;  // Error "Context before hardfault:"
```

Because `dev` is allocated on the stack, when the `remote_device_add` function returns `ptr->next` contains a pointer to garbage memory, you may want to allocate it on the heap or do use static memory for this. Thats why it only works the first time, calling it a second/third time might not work properly.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/issues/16517#issuecomment-851936349
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210601/ecbf21f7/attachment.htm>


More information about the notifications mailing list