Skip to content
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

Segmetation Fault Occurs on Downlink #194

Open
factoryal opened this issue Sep 14, 2020 · 6 comments
Open

Segmetation Fault Occurs on Downlink #194

factoryal opened this issue Sep 14, 2020 · 6 comments
Labels

Comments

@factoryal
Copy link

factoryal commented Sep 14, 2020

Hi.

I'm trying to run mbed-os-example-lorawan with B-L072Z-LRWAN1 board.
only changes are some configurations on mbed_app.json

"target_overrides": {
        "*": {
            "platform.stdio-convert-newlines": true,
            "platform.stdio-baud-rate": 115200,
            "platform.default-serial-baud-rate": 115200,
            "lora.over-the-air-activation": true,
            "lora.duty-cycle-on": false,
            "target.components_add": ["SX1272", "SX1276", "SX126X"],
            "lora.phy": "KR920",
            "lora.device-eui": "(My 8-bytes device-eui key)",
            "lora.application-eui": "(My 8-bytes application-eui)",
            "lora.application-key": "(My 16-bytes application-key)"
        },

When downlink from TTN occurs, the whole program stops.
Running debug, I got this debug output.

image

Attached to debugger on port 50000
0003295:INFO:loader:Erased 0 bytes (0 sectors), programmed 0 bytes (0 pages), skipped 100480 bytes (785 pages) at 44.78 kB/s
Image loaded: \Users\vkdls\Mbed Programs\mbed-os-example-lorawan2\BUILD\DISCO_L072CZ_LRWAN1\ARMC6\mbed-os-example-lorawan2.elf
Note: automatically using hardware breakpoints for read-only addresses.
[New Thread 536878128]
[New Thread 536878196]
[New Thread 536878264]
[New Thread 536881424]
[Switching to Thread 536878128]
Thread 2 "main" hit Breakpoint 1, main () at ./main.cpp:96
96	    setup_trace();
[New Thread 2]
Thread 
6 "Handler mode" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 2]
0x080001c4 in HardFault_Handler ()

mbed-os: 890f056
example: 0048d61

Is there any solution?

Thanks.

@ciarmcom
Copy link
Member

ARM Internal Ref: IOTCELL-2471

@SKRahulSK
Copy link

SKRahulSK commented Sep 25, 2020

Hi,

I am also facing the same problem when I send a downlink from TTN console to the device.
Did you find any solution?

Thanks,
Rahul

@factoryal
Copy link
Author

@SKRahulSK Hi.
I didn't find any solution right now.

I tested for couple of weeks to find the reason why whole program stopped when downlink occures.
I finally run debug and found that segmentation fault was the reason. (I might find this earlier but not since pyOCD didn't worked for some reason 🤔)

I'm not a core developer. so I can't do any more at this moment.
I'm just waiting for their solution.
Hope they solve this problem quickly.

Thanks for reply. :)

@PablOsma
Copy link

PablOsma commented Jan 29, 2021

hi,
try increasing the main thread stack size, that did the trick for me.

in mbed_app.json
image

or directly on mbed_config.h
image

good luck!

@factoryal
Copy link
Author

Hi. @PablOsma Thanks for reply.

I increased stack size of my board from 1024 to 2048 and it works!
I really appreciate for that. Thank you so much!

@SKRahulSK would you try this solution?

@factoryal
Copy link
Author

Plus, I also tried downlink from Chirpstack and it also works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants