Commit Graph

6 Commits

Author SHA1 Message Date
true d0d07b82f6 main firmware: basic user UI, setting save / restore added
Can now use the buttons to change programs, change active LED zones, change LED brightness and enter and exit programming mode. Exiting programming mode will save settings. Holding MODE upon boot will load defaults (though not overwrite them in EEPROM).

Also added basic power management. If the badge is still for 15min, LEDs will go out. When LEDs are blank due to brightness off setting or timeout, they are turned off to save power. Moving badge, entering programming mode, changing the program, or changing brightness will enable the LEDs.
2023-08-04 02:13:47 -07:00
true 7bbd46fe5f main firmware: WIP
very rough WIP of main badge code.

some LED programs are here, and it will build if the btn code is excluded.
2023-08-03 18:48:16 -07:00
true 46a3ab6007 bootloader: flash page erase is on-demand, now fits in 2K
Flash pages are only erased as needed during the flash routine, which makes flashing faster as well as making the transfer consistent.

Later datasheets have the flash clock set to 2MHz. I've set it to 2MHz here. I may undo this change later depending on how slow loading a 14K firmware feels.

Was able to save enough space to reduce bootloader size from almost 2.5K to 2K exactly. Adjusted flash offsets to start from 0x800.

GPIO values are now mostly reset to power-on defaults.

Fixed some formatting. Removed dead code.
2023-06-25 05:01:16 -07:00
true d5cbabf830 Add STM32CubeIDE patches
Patches to allow programming and debugging using a JLINK within the STM32CubeIDE environment.

Also firmware to turn STM32F103 into JLink-OB. However you will need to click on "No" every time you launch.

From memory, these are the pins used:
PA5 SWDCK
PA4 SWDIO
PA2 !RST (unneeded)

You may need to attach a 100ohm resistor from PA7 to PA4 for this to work.
2023-06-25 01:43:58 -07:00
true a47cfa7fa5 Initial bootloader implementation
Took a publicly available XMODEM bootloader and made it work on HK32F.

Known issues:
- Erase is super slow on this MCU. The upload routine erases all flash before loading, which means the first packet seems to hang. This also erases possibly persistent data stored in unused pages on flash.
2023-06-25 01:41:36 -07:00
true 861caf8bce Initial commit 2023-06-25 01:21:36 -07:00