Skip to content

Firmware_details

Cedric Beauduffe edited this page Feb 2, 2024 · 6 revisions

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

3.2.1. Open Project

3.2.2. flags configuration

3.2.3. Program and debug device