ImperialSpaceSociety / LoRaMac-node

Reference implementation and documentation of a LoRa network node.
Other
6 stars 1 forks source link

After uploading code, it stops working?? #371

Closed MedadRufus closed 2 years ago

MedadRufus commented 2 years ago

uploading flight_code_17_Dec_2021.hex occasionally does not allow it to startup. Steps to reproduce:

  1. wipe eeprom through stm32cube programmer
  2. upload this code.

Symptoms: you will be able to connect and program it again. Serial output looks like this: image

MedadRufus commented 2 years ago

On the other tracker with suspected faulty crystal, the code runs around half speed.

MedadRufus commented 2 years ago

The code running was commit ada63af147ea638ade7f7e273604b91ddbc73322

MedadRufus commented 2 years ago

Issue still present when low power disabled.

MedadRufus commented 2 years ago

Symptoms:

  1. even after programming, its possible to program the device. This should not happen when it goes into low power mode.
  2. After programming, it will not blink or run any code.

Possible sources of error:

  1. Somehow, boot0 is pulled up. I have accidentally discovered that if boot0 is pulled up, it will only run the code for eeprom wiper, but not the flight code.
  2. The LSE crystal is not working.
MedadRufus commented 2 years ago

its not boot0 is pulled up. Could be LSE crystal failure. But its a mystery to me why the first program runs, but not the second.

MedadRufus commented 2 years ago

Switching to running only on LSI does not fix it.

MedadRufus commented 2 years ago

Could somehow, boot0 be pulled up by a soldering error??

MedadRufus commented 2 years ago

Consider sending Steve a few firmware images, and let him load and check if they run. Try to divide and conquer.

MedadRufus commented 2 years ago

All the info I have from Steve:

MedadRufus commented 2 years ago

Could somehow, the MCU on Steve's tracker have a smaller flash space due to different variant of processor? I have the STM32L082CZ variant in testing. But I think the processor on Steve's tracker was from another batch of ABZ modules, from Richard.

MedadRufus commented 2 years ago

The ABZ module variants are:

  1. CMWX1ZZABZ-091
  2. CMWX1ZZABZ-093
  3. CMWX1ZZABZ-078 image

Note that Steve's tracker could handle the old picotracker lora code(compiled with keil). I don't know that code size. Maybe check what size that was.

MedadRufus commented 2 years ago

Compiling the old picotracker code(commit 90b6139331d7e5baef461a63c06570be112ad7e4), I see that it compiles to 99708 bytes:

.\mlm32l07x01\Picotracker_lora.axf: error: L6050U: The code size of this image (99708 bytes) exceeds the maximum allowed for this version of the linker.

So maybe somehow, the MCU on Steve's tracker is a 128kb flash version, not 192 kb flash. 66kb and 99kb sized images load and run OK, but not 178 kb images.

MedadRufus commented 2 years ago

Something to think about: could somehow, a soldering error be causing the tracker to use only the first flash bank? I know setting the boot0 and boot1 pins will make a difference.