Skip to content

Commit

Permalink
Added guide for compiling under Windows (#2060)
Browse files Browse the repository at this point in the history
* Update documentation to build IronOS in Windows using MSYS2 environment and fix compilation on case-sensitive file systems.

---------

Co-authored-by: Ivan Zorin <ivan.a.zorin@gmail.com>
  • Loading branch information
resistancelion and ia authored Feb 7, 2025
1 parent 4ce63fa commit 08ff68c
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 18 deletions.
36 changes: 36 additions & 0 deletions Documentation/Development.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,42 @@ You will need to update the build settings for include paths and point to the ne
In the `source` folder there is a `Makefile` that can be used to build the repository using command line tools.
When running the `make` command, specify which model of the device and the language(s) you would like to use.

### Windows (MSYS2 environment)

1. Download `msys2` install package from the [official website](https://msys2.org) and install it according to the instruction there;
2. Install requried packages (here and for the future commands use **`mingw64.exe`** terminal):
```
$ pacman -S mingw-w64-x86_64-arm-none-eabi-gcc mingw-w64-x86_64-libwinpthread-git python3 python3-pip make unzip git
```
3. Download _3rd party RISC-V toolchain_ `xpack-riscv-none-elf-gcc-...-win32-x64.zip` from [this repository](https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases);
4. Move downloaded `xpack-riscv-none-elf-gcc-...-win32-x64.zip` to `msys64` _Windows_ directory (e.g., `C:\msys64\`);
5. Extract files from `xpack-riscv-none-elf-gcc-...-win32-x64.zip` and go back to _home_ directory:
```
$ cd /
$ unzip xpack-riscv-none-elf-gcc-...-win32-x64.zip
$ cd ~
```
6. Permanently set `PATH` environment variable, so all required toolchains could be available for `make` and for other build scripts:
```
$ echo 'export PATH=/xpack-riscv-none-elf-gcc-.../bin:${PATH}' >> ~/.bashrc
$ source ~/.bashrc
```
7. Additionally, `OpenOCD` and/or `ST-Link` can be installed as well to help with flashing:
```
$ pacman -S mingw-w64-x86_64-openocd
$ pacman -S mingw-w64-x86_64-stlink
```
8. Clone _IronOS_ repo:
```
$ git clone --recursive https://github.com/Ralim/IronOS.git
$ cd IronOS
```
9. Follow steps _4-8_ from [macOS section](#macos);
10. `pip` can be updated inside `venv` only:
```
$ python3 -m pip install --upgrade pip
```

### macOS

Use the following steps to set up a build environment for IronOS on the command line (in Terminal).
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/MHP30/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "Pins.h"
#include "Setup.h"
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "WS2812.h"
#include "configuration.h"
#include "history.hpp"
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/MHP30/ThermoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "Setup.h"
#include "TipThermoModel.h"
#include "Types.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"

extern uint16_t tipSenseResistancex10Ohms;
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Miniware/ThermoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"

#ifdef TEMP_uV_LOOKUP_HAKKO
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Pinecil/ThermoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"

#ifdef TEMP_uV_LOOKUP_HAKKO
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Pinecilv2/BSP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "Setup.h"
#include "TipThermoModel.h"
#include "USBPD.h"
#include "Utils.h"
#include "Utils.hpp"
#include "bl702_adc.h"
#include "configuration.h"
#include "crc32.h"
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Pinecilv2/ThermoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"

#ifdef TEMP_uV_LOOKUP_HAKKO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "types.h"
#include <zephyr/types.h>
#include "bl_port.h"

#define BT_UINT_MAX 0xffffffff
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Pinecilv2/ble_peripheral.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ NOTES
#ifndef _BLE_TP_SVC_H_
#define _BLE_TP_SVC_H_

#include "types.h"
#include <zephyr/types.h>
#include "ble_config.h"

// read value handle offset 2
Expand Down
2 changes: 1 addition & 1 deletion source/Core/BSP/Sequre/ThermoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Author: Ralim
*/
#include "TipThermoModel.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"

#ifdef TEMP_uV_LOOKUP_PT1000
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Drivers/HUB238.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "HUB238.hpp"
#include "I2CBB2.hpp"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"

#if POW_PD_EXT == 1
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Drivers/TipThermoModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "BSP.h"
#include "Settings.h"
#include "Types.h"
#include "Utils.h"
#include "Utils.hpp"
#include "configuration.h"
#include "main.hpp"
#include "power.hpp"
Expand Down
2 changes: 1 addition & 1 deletion source/Core/Drivers/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "BSP_Power.h"
#include "Settings.h"
#include "configuration.h"
#include <Utils.h>
#include <Utils.hpp>

int32_t Utils::InterpolateLookupTable(const int32_t *lookupTable, const int noItems, const int32_t value) {
for (int i = 1; i < (noItems - 1); i++) {
Expand Down
8 changes: 4 additions & 4 deletions source/Core/Drivers/Utils.h → source/Core/Drivers/Utils.hpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* Utils.h
* Utils.hpp
*
* Created on: 28 Apr 2021
* Author: Ralim
*/

#ifndef CORE_DRIVERS_UTILS_H_
#define CORE_DRIVERS_UTILS_H_
#ifndef CORE_DRIVERS_UTILS_HPP_
#define CORE_DRIVERS_UTILS_HPP_
#include <stdint.h>
class Utils {
public:
Expand All @@ -18,4 +18,4 @@ class Utils {

};

#endif /* CORE_DRIVERS_UTILS_H_ */
#endif /* CORE_DRIVERS_UTILS_HPP_ */
2 changes: 1 addition & 1 deletion source/Core/Inc/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

typedef int32_t TemperatureType_t;

#endif
#endif
2 changes: 1 addition & 1 deletion source/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ DEV_GLOBAL_DEFS=-DCFG_FREERTOS \
# -DCONFIG_BT_SMP

# Required to be turned off due to their drivers tripping warnings
DEV_CFLAGS=-Wno-error=enum-conversion -Wno-type-limits -Wno-implicit-fallthrough
DEV_CFLAGS=-Wno-error=enum-conversion -Wno-type-limits -Wno-implicit-fallthrough -Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types
DEV_CXXFLAGS=$(DEV_CFLAGS)
flash_size=128k
bootldr_size=0x0
Expand Down

0 comments on commit 08ff68c

Please sign in to comment.