ahhh shit here we go again
This commit is contained in:
8
.gitignore
vendored
8
.gitignore
vendored
@@ -1,3 +1,9 @@
|
||||
build/
|
||||
.vscode/
|
||||
|
||||
tools/
|
||||
.cache/
|
||||
.west/
|
||||
.vscode/
|
||||
zephyr/
|
||||
modules/
|
||||
bootloader/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
|
||||
set(BOARD adafruit_feather_nrf52840)
|
||||
set(BOARD rpi_pico)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
project(passr)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
||||
|
||||
20
Makefile
Normal file
20
Makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
.ONESHELL:
|
||||
|
||||
TARGET=rpi_pico
|
||||
|
||||
CMAKE_ZEPHYR_PATH=../zephyrproject/zephyr
|
||||
CMAKE_ZEPHYR_COMMAND=west build
|
||||
CMAKE_ZEPHYR_FLAGS=-b $(TARGET)
|
||||
|
||||
all: flash
|
||||
|
||||
compile:
|
||||
$(CMAKE_ZEPHYR_COMMAND) $(CMAKE_ZEPHYR_FLAGS)
|
||||
|
||||
# FIXME: This is entirely board specific, for example the pi pico will vibe differently
|
||||
flash:
|
||||
west flash
|
||||
|
||||
clean:
|
||||
rm -rf build/
|
||||
mkdir build
|
||||
14
README.md
Normal file
14
README.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# Passr
|
||||
|
||||
## Building
|
||||
|
||||
Install Zephyr, the Zephyr SDK and West
|
||||
|
||||
```sh
|
||||
west init
|
||||
west update
|
||||
make build
|
||||
```
|
||||
|
||||
The project is currently configured to run on a Pi Pico as my nrf development board is misbehaving
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
west build -b adafruit_feather_nrf52840 .
|
||||
nrfutil dfu genpkg --application build/zephyr/zephyr.hex --application-version 0xFF --dev-revision 0xFF --dev-type 0xFFFF --sd-req 0x81 feather_nrf52840_express_bootloader-0.7.0_s140_6.1.1.zip
|
||||
# nrfutil dfu genpkg --application build/zephyr/zephyr.hex --application-version 0xFF --dev-revision 0xFF --dev-type 0xFFFF --sd-req 0x81 feather_nrf52840_express_bootloader-0.7.0_s140_6.1.1.zip
|
||||
# nrfutil dfu usb-serial -pkg app.zip -p ttyACM0 // DO NOT FUCKING DO THIS
|
||||
# ./uf2conv.py build/zephyr/zephyr.hex -c -f 0xADA52840
|
||||
cp build/zephyr/zephyr.uf2 .
|
||||
|
||||
20
feather_bootloader/manifest.json
Normal file
20
feather_bootloader/manifest.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"manifest": {
|
||||
"dfu_version": 0.5,
|
||||
"softdevice_bootloader": {
|
||||
"bin_file": "sd_bl.bin",
|
||||
"bl_size": 39000,
|
||||
"dat_file": "sd_bl.dat",
|
||||
"init_packet_data": {
|
||||
"application_version": 4294967295,
|
||||
"device_revision": 52840,
|
||||
"device_type": 82,
|
||||
"firmware_crc16": 40783,
|
||||
"softdevice_req": [
|
||||
65534
|
||||
]
|
||||
},
|
||||
"sd_size": 151016
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
feather_bootloader/sd_bl.bin
Normal file
BIN
feather_bootloader/sd_bl.bin
Normal file
Binary file not shown.
BIN
feather_bootloader/sd_bl.dat
Normal file
BIN
feather_bootloader/sd_bl.dat
Normal file
Binary file not shown.
1
prj.conf
1
prj.conf
@@ -1,3 +1,4 @@
|
||||
CONFIG_BUILD_OUTPUT_UF2=y
|
||||
CONFIG_GPIO=y
|
||||
# CONFIG_BT=y
|
||||
# CONFIG_BT_DEBUG_LOG=y
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#define SLEEP_TIME_MS 1000
|
||||
|
||||
/* The devicetree node identifier for the "led0" alias. */
|
||||
#define LED0_NODE DT_ALIAS(led1)
|
||||
#define LED0_NODE DT_ALIAS(led0)
|
||||
|
||||
/*
|
||||
* A build error on this line means your board is unsupported.
|
||||
@@ -18,8 +18,7 @@ void main(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!device_is_ready(led.port)) {
|
||||
return;
|
||||
while (!device_is_ready(led.port)) {
|
||||
}
|
||||
|
||||
ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
|
||||
@@ -27,6 +26,8 @@ void main(void)
|
||||
return;
|
||||
}
|
||||
|
||||
gpio_pin_set_dt(&led, GPIO_OUTPUT_HIGH);
|
||||
|
||||
while (1) {
|
||||
ret = gpio_pin_toggle_dt(&led);
|
||||
if (ret < 0) {
|
||||
|
||||
Reference in New Issue
Block a user