{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8754","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8754/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8754/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8754/events","html_url":"https://github.com/RIOT-OS/RIOT/issues/8754","id":303327358,"number":8754,"title":"CC101x Initialization kernel panic","user":{"login":"Citrullin","id":4502018,"avatar_url":"https://avatars0.githubusercontent.com/u/4502018?v=4","gravatar_id":"","url":"https://api.github.com/users/Citrullin","html_url":"https://github.com/Citrullin","followers_url":"https://api.github.com/users/Citrullin/followers","following_url":"https://api.github.com/users/Citrullin/following{/other_user}","gists_url":"https://api.github.com/users/Citrullin/gists{/gist_id}","starred_url":"https://api.github.com/users/Citrullin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Citrullin/subscriptions","organizations_url":"https://api.github.com/users/Citrullin/orgs","repos_url":"https://api.github.com/users/Citrullin/repos","events_url":"https://api.github.com/users/Citrullin/events{/privacy}","received_events_url":"https://api.github.com/users/Citrullin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-08T01:54:14Z","updated_at":"2018-03-08T07:08:38Z","closed_at":null,"author_association":"NONE","body":"Hi, I currently checked the following pull request: https://github.com/RIOT-OS/RIOT/pull/8437\r\n\r\nI wrote the following code\r\n```\r\n#include <stdio.h>\r\n\r\n#include \"radio.h\"\r\n#include \"tlsf-malloc.h\"\r\n#include \"msg.h\"\r\n#include \"shell.h\"\r\n#include \"ccn-lite-riot.h\"\r\n#include \"net/gnrc/netif.h\"\r\n#include \"net/gnrc/pktdump.h\"\r\n\r\n#include \"cc110x.h\"\r\n#include \"cc110x_params.h\"\r\n#include \"gnrc_netif_cc110x.h\"\r\n#include \"cc110x-netdev.h\"\r\n\r\n/* main thread's message queue */\r\n#define MAIN_QUEUE_SIZE     (2)\r\nstatic msg_t _main_msg_queue[MAIN_QUEUE_SIZE];\r\n\r\n/* 10kB buffer for the heap should be enough for everyone */\r\n#define TLSF_BUFFER     (5600 / sizeof(uint32_t))\r\nstatic uint32_t _tlsf_heap[TLSF_BUFFER];\r\n\r\nint main(void)\r\n{\r\n    printf(\"You are running RIOT on a(n) %s board.\\n\", RIOT_BOARD);\r\n    tlsf_create_with_pool(_tlsf_heap, sizeof(_tlsf_heap));\r\n    msg_init_queue(_main_msg_queue, MAIN_QUEUE_SIZE);\r\n\r\n    puts(\"Basic CCN-Lite example\");\r\n\r\n    ccnl_core_init();\r\n\r\n    ccnl_start();\r\n\r\n    char stack[50];\r\n    netdev_cc110x_t* netdev_cc110x = (netdev_cc110x_t*) malloc(sizeof(netdev_cc110x_t));\r\n    netdev_cc110x_setup(netdev_cc110x, cc110x_params);\r\n    gnrc_netif_t *netif = gnrc_netif_cc110x_create(stack, 50, 'X', \"main\", &(netdev_cc110x->netdev));\r\n\r\n    if (((netif = gnrc_netif_iter(NULL)) == NULL) ||\r\n        (ccnl_open_netif(netif->pid, GNRC_NETTYPE_CCN) < 0)) {\r\n        puts(\"Error registering at network interface!\");\r\n        return -1;\r\n    }\r\n\r\n#ifdef MODULE_NETIF\r\n    gnrc_netreg_entry_t dump = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX_CTX_ALL,\r\n                                                          gnrc_pktdump_pid);\r\n    gnrc_netreg_register(GNRC_NETTYPE_CCN_CHUNK, &dump);\r\n#endif\r\n\r\n    return 0;\r\n}\r\n```\r\nI don't think that especially this part is correct:\r\n```\r\ngnrc_netif_cc110x_create(stack, 50, 'X', \"main\", &(netdev_cc110x->netdev));\r\n```\r\nI can compile it and the MCU even starts. But it results in a kernel panic:\r\n```\r\ncc110x: initialized with address=138 and channel=0\r\n0x8007c27\r\n*** RIOT kernel panic:\r\nFAILED ASSERTION.\r\n\r\n\tpid | name                 | state    Q | pri | stack  ( used) | base addr  | current     \r\n\t  - | isr_stack            | -        - |   - |    512 (  132) | 0x20000000 | 0x200001c8\r\n\t  1 | idle                 | pending  Q |  15 |    256 (  132) | 0x20000450 | 0x200004cc \r\n\t  2 | main                 | running  Q |   7 |   1536 (  896) | 0x20000550 | 0x200008dc \r\n\t  3 | pktdump              | bl rx    _ |   6 |   1536 (  236) | 0x200043e0 | 0x200048f4 \r\n\t  4 | ccnl                 | bl rx    _ |   6 |   1536 (  176) | 0x20002504 | 0x20002a54 \r\n\t    | SUM                  |            |     |   5376 ( 1572)\r\n\r\nHeap usage:\r\n\tMemory @ 0x20001880 is used, size: 68 (block: 0x20001878)\r\n\tMemory @ 0x200018c8 is used, size: 192 (block: 0x200018c0)\r\n\tMemory @ 0x2000198c is free, size: 2136 (block: 0x20001984)\r\n\r\n*** halted.\r\n```\r\nI don't understand this kernel panic message. What assertion failed? \r\n"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/371399920","html_url":"https://github.com/RIOT-OS/RIOT/issues/8754#issuecomment-371399920","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8754","id":371399920,"user":{"login":"aabadie","id":1375137,"avatar_url":"https://avatars3.githubusercontent.com/u/1375137?v=4","gravatar_id":"","url":"https://api.github.com/users/aabadie","html_url":"https://github.com/aabadie","followers_url":"https://api.github.com/users/aabadie/followers","following_url":"https://api.github.com/users/aabadie/following{/other_user}","gists_url":"https://api.github.com/users/aabadie/gists{/gist_id}","starred_url":"https://api.github.com/users/aabadie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aabadie/subscriptions","organizations_url":"https://api.github.com/users/aabadie/orgs","repos_url":"https://api.github.com/users/aabadie/repos","events_url":"https://api.github.com/users/aabadie/events{/privacy}","received_events_url":"https://api.github.com/users/aabadie/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T07:08:38Z","updated_at":"2018-03-08T07:08:38Z","author_association":"CONTRIBUTOR","body":"> What assertion failed?\r\n\r\nPrefix your build command with `CFLAGS=-DDEBUG_ASSERT_VERBOSE`, you'll see where the assertion failed. "}}
{"actor":{"display_login":"aabadie"}}