DeviationTX / deviation

Custom firmware for RC Transmitters
http://www.deviationtx.com
GNU General Public License v3.0
247 stars 153 forks source link

redpine white-screens on Devo7e #1002

Closed bkleiner closed 3 years ago

bkleiner commented 3 years ago

With https://github.com/DeviationTX/deviation/pull/1001 merged the devo7e seems to white-screen upon repine protocol selection. I do not own a 7e myself, only got reports by a buddy, to go off:

Flashed the latest nightly to Devo7e, get same result - when redpine is selected, I get a white screen and radio will not power down

Find attached the ERRORS.TXT and the debug-devo7e-v5.0.0-dcfee1f.zip

What could be causing this issue? would be more then happy to submit another PR.

TheRealMoeder commented 3 years ago

It crashes in static void redpine_init(unsigned int format), probably not all statics are initialized in the modular build and this messes things up. Will debug further.

TheRealMoeder commented 3 years ago

I tried to reproduce the issue, but everything works fine here with redpine in a modular build on t8sg_v2...

somewhatlurker commented 3 years ago

I notice that the format variable is initialised to 0 and therefore placed in .bss. Does the module loader initialise bss to 0 like the buildchain expects? I don't see that in the code. If it doesn't, format may not be initialised before the first call to redpine_init, leading to an out-of-bounds read.

If the above is correct, we should probably zero the module memory before loading to ensure it can't happen again.

goebish commented 3 years ago

unsigned format = 0; is bad for modular build, it should be initialized in a function.

TheRealMoeder commented 3 years ago

@bkleiner Next nightly version should contain the fix, please ask your buddy to try again with the updated build

bkleiner commented 3 years ago

You just beat me to the punch, was just sitting down to give the bss theory a test. We will test and report back, thanks!

bkleiner commented 3 years ago

With the latest nightly selecting the redpine protocol no longer crashes the radio. However it seems to not bind up with the RX. There is a possibility my receiver implementation is at fault here, it seems to work just fine with other radios though. We will investigate and report back.

My bud did mention that the TX Power setting only allows him to select "default" for redpine, not sure if that is related at all.

vladislavy commented 3 years ago

Cneck if "hardware.ini" has has_pa-cc2500 = 1

"default" will be with that line commented ; has_pa-cc2500 = 1

bkleiner commented 3 years ago

Sorry for the delay. Seems there was a bit of a miscommunication on our end, with the latest fixes it’s all working. Issue can be closed imho.

TheRealMoeder commented 3 years ago

Great! Thanks for helping to track the bug!