Firmware_details - sigfox-tech-radio/sigfox-ep-example-holtek-bc68f2150 GitHub Wiki
3.1. Architecture
In order to be reader-friendly, the firmware architecture is divided into three software layer :
- Application is the application layer.
- Middleware (often called third-party) contains a git submodule ot the sigfox-ep-library and manufacturer APIs specific to the bc68f2150 (these manufacturer API make the link between Soc peripherial an sigfox library).
- Driver contain some drivers which requires more logic than just configuring registers.
To reduce the memory footprint and stack's depth some SoC registers can be configured directly in all layers.
3.1.1. Files organisation
This firmware architecture is found in file organisation. Just some other specific files are necessary to open and configure IDE.
As the sigfox-ep-library is a git submodule, source file of the library are not present in this repository. To add it initialise and update the submodule (see https://git-scm.com/book/en/v2/Git-Tools-Submodules) or copy paste sigfox-ep-lib repository in sigfox-ep-lib folder.
. # Root directory
โโโ middleware # Middleware
โ โโโ sigfox # Sigfox middleware subdirectory
โ โ โโโ sigfox-ep-lib # EP_LIB submodule
โ โ โ โโโ ...
โ โ โโโ manuf # EP_LIB manufacturer API specific to this SoC
โ โ โ โโโ mcu_api.c
โ โ โ โโโ rf_api.c
โ โ โ โโโ mcu_rf_api_rodata.c
โ โ โ โโโ mcu_rf_api_rodata.h
โ โ โ โโโ TI_aes_128_encr_only.c
โ โ โ โโโ TI_aes_128_encr_only.h
โโโ driver # Drivers
โ โ โโโ src # Driver header subdirectory
โ โ โ โโโ iap.h
โ โ โโโ src # Driver source subdirectory
โ โ โ โโโ iap.c
โโโ output # Output generation folder, containing all generated files by IDE
โ โโโ *.OBJ
โ โโโ *.ASM
โ โโโ *.LST
โ โโโ *...
โโโ main.c # Application source file
โโโ lcd.opt # Project option file
โโโ lcd.pjt # Project file
โโโ lcd.pjtx # Project file
โโโ README.md
3.1.2. Peripherals
[!NOTE] In the actual firmware example, the Sleep mode has not been implemented and remains to be done by the partner if needeed. (to reach ยตA consumption in Idle)
[!IMPORTANT]
Holtek recommend to use the LVD (Low voltage detector) enabled during the frame transmission, particularly when using some Coincells or frugal batteries, to be able to detect a big dropout and to be capable to alert thru a message when the battery can reach minimum VDD voltage.
3.2. IDE
The IDE used for this project is HT-IDE300 . This IDE provided by Holtek includes all tools necessary for binary generating (Compiler, Linker, code editor, etc.). The user guide and programming guide is available in 'Help' menu of IDE. To Flash and debug it is necessary to use the (e-link)[https://www.holtek.com/page/detail/ice/e-link] probe tools provided by Holtek.
[!NOTE] Theses tools (IDE and Probe) can be installed on Ubuntu under wine but somtimes the Probe may not be detected. A workaround can be apply to solve this issue. This workaround consist of change e-link hidraw permission and to add "Enable SDL"=dword:00000000 "DisableInput"=dword:00000001 keys in the wine system register (.wine/system.reg file).
Rules: KERNEL=="hidraw*", MODE="666", TAG+="uaccess"KERNEL=="hiddev*", MODE="666", TAG+="uaccess"
.wine/system.reg patch file in System\CurrentControlSet\Services\winebus block: "DisableInput"=dword:00000001"Enable SDL"=dword:00000000