portapack-mayhem / mayhem-firmware

Custom firmware for the HackRF+PortaPack H1/H2/H4
https://hackrf.app
GNU General Public License v3.0
3.38k stars 550 forks source link

Double-clicking power button starts Config Mode & disables TXCO on r9 #1693

Closed NotherNgineer closed 9 months ago

NotherNgineer commented 9 months ago

Starting from a power-off state, I accidentally double-clicked the encoder button which briefly powers the PortaPack on & off. Later I press the encoder button once to power on. Result is as follows:

  1. Using 1.7.4 firmware and earlier, firmware always starts up properly after the sequence above.
  2. Using 1.8.0 firmware and later, the screen stays blank and the top LEDs all blink rapidly until powered off (apparently this is "Config Mode" per PR 1433 and https://github.com/eried/portapack-mayhem/wiki/Config-Menu). In the case of an R9 board, firmware will update Pmem to disable the TXCO.

A workaround is simply to power cycle, but, if it's a HackRF R9 board, the user will probably want to re-enable the TXCO in Settings->Radio.

Firmware enters "Config Mode" following any start-up failure and an accidental double-press of the encoder button will cause a start-up failure as far as firmware is concerned. I changed this to enhancement suggestion since it could be resolved by adding a delay at power-up or other methods TBD.

jLynx commented 9 months ago

So you only have this issue when TXCO is enabled?

NotherNgineer commented 9 months ago

This occurs regardless whether TXCO is configured to be enabled or not.

jLynx commented 9 months ago

gotcha

NotherNgineer commented 9 months ago

Looks like this issue was introduced in PR #1433 (n230905 nightly release).

jLynx commented 9 months ago

@bernd-herzog related to our change. Apparently works regardless on weather it's enabled or not

NotherNgineer commented 9 months ago

It seems that this may be expected behavior when the encoder knob is accidentally pressed twice (starting from an off state), because the CPLD shuts power back off quickly and it looks to firmware like a start-up failure.

I found this helpful Wiki page from @bernd-herzog that explains the blinking "config mode" state that Mayhem firmware enters into following any start-up failure: https://github.com/eried/portapack-mayhem/wiki/Config-Menu

It is unfortunate that there's nothing on the display to indicate what's happening, and that this accidental double-press of the encoder button results in the external clock being shut off unnecessarily on r9 boards. Possible enhancements perhaps?

NotherNgineer commented 9 months ago

Sometimes Config Mode is started when I plug in the USB cable. Maybe some electrical glitches when the contacts are being made.

gullradriel commented 9 months ago

Sometimes Config Mode is started when I plug in the USB cable. Maybe some electrical glitches when the contacts are being made.

Same here

ETHANATTI commented 9 months ago

I can't turn off my device. Is it possible?

NotherNgineer commented 9 months ago

I can't turn off my device. Is it possible?

Make sure the USB cable is disconnected and double-click the encoder button to turn it off. The CPLD may need to be programmed if that doesn't work.

NotherNgineer commented 9 months ago

To work around the original complaint above, perhaps we could add a new setting in persistent memory to disable Config Mode. (If Config Mode was really really needed after it was disabled then I could pull out the coin cell battery to reset the persistent memory.)

gullradriel commented 9 months ago

To work around the original complaint above, perhaps we could add a new setting in persistent memory to disable Config Mode. (If Config Mode was really really needed after it was disabled then I could pull out the coin cell battery to reset the persistent memory.)

Good idea