Skip to content

Firmware

Dilshan R Jayakody edited this page Dec 30, 2022 · 15 revisions

Building the source code

The firmware of the 6-channel speaker selector is developed using SDCC. To build the firmware, install the SDCC version 4.0.0 or newer version.

After cloning the project repository, issue the following commands to build the STC15W201 firmware:

cd firmware
make

If the compilation is successful, the output file (spk-selector.ihx) is generated in the same directory.

Flash firmware

To flash the firmware connect the STC programmer or 5V UART to the USB adapter to the ISP port (J12).

ISP port

ISP port pinouts are clearly marked on top side of the PCB.

To transfer the firmware, the Make file uses stcgal. The latest version of stcgal can obtain through PIP:

pip3 install stcgal

To transfer the firmware, follow the steps listed below:

  1. Apply power (DC 12V) to the speaker selector board.
  2. Start stgcal by issuing the make flash command.
  3. Disconnect power to the speaker selector board for 2 - 3 seconds.
  4. Reapply the power to initiate the firmware transfer through the MCU bootloader.
Clone this wiki locally