Skip to content

Commit

Permalink
Add support nrf5340
Browse files Browse the repository at this point in the history
  • Loading branch information
beastoin committed Dec 18, 2024
1 parent 97b1003 commit 4f1a309
Show file tree
Hide file tree
Showing 9 changed files with 433 additions and 66 deletions.
122 changes: 71 additions & 51 deletions Friend/firmware/firmware_v1.0/CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,78 @@
{
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "build_xiao_ble_sense_devkitv1",
"displayName": "Devkit V1",
"configuration": "Debug",
"hidden": false,
"description": "Debug build for devkit v1 device with no external modules",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/build_xiao_ble_sense_devkitv1",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"CMAKE_BUILD_TYPE": "Debug",
"PLATFORM": "nrf52840",
"BOARD": "xiao_ble_sense",
"CACHED_CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv1.conf"
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "build_xiao_ble_sense_devkitv1",
"displayName": "Devkit V1",
"configuration": "Debug",
"hidden": false,
"description": "Debug build for devkit v1 device with no external modules",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/build_xiao_ble_sense_devkitv1",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"CMAKE_BUILD_TYPE": "Debug",
"PLATFORM": "nrf52840",
"BOARD": "xiao_ble_sense",
"CACHED_CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv1.conf"
}
},{
"name": "build_xiao_ble_sense_devkitv1-spisd.",
"displayName": "Devkit V1 (with SPI SD)",
"configuration": "Debug",
"hidden": false,
"description": "Debug build for devkit v1 device with external SPI SD card module",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/build_xiao_ble_sense_devkitv1-spisd",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"CMAKE_BUILD_TYPE": "Debug",
"PLATFORM": "nrf52840",
"BOARD": "xiao_ble_sense",
"CACHED_CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv1-spisd.conf",
"DTC_OVERLAY_FILE": "${sourceDir}/overlay/xiao_ble_sense_devkitv1-spisd.overlay"
},
{
"name": "build_xiao_ble_sense_devkitv1-spisd.",
"displayName": "Devkit V1 (with SPI SD)",
"configuration": "Debug",
"hidden": false,
"description": "Debug build for devkit v1 device with external SPI SD card module",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/build_xiao_ble_sense_devkitv1-spisd",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"CMAKE_BUILD_TYPE": "Debug",
"PLATFORM": "nrf52840",
"BOARD": "xiao_ble_sense",
"CACHED_CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv1-spisd.conf",
"DTC_OVERLAY_FILE": "${sourceDir}/overlay/xiao_ble_sense_devkitv1-spisd.overlay"
}
},{
"name": "build_xiao_ble_sense_devkitv2-adafruit.",
"displayName": "Devkit V2 (with Adafruit BFF Module)",
"configuration": "Debug",
"hidden": false,
"description": "Debug build for devkit v2 device with adafruit audio bff module",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/build_xiao_ble_sense_devkitv2-adafruit",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"CMAKE_BUILD_TYPE": "Debug",
"PLATFORM": "nrf52840",
"BOARD": "xiao_ble_sense",
"CACHED_CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv2-adafruit.conf",
"CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv2-adafruit.conf",
"DTC_OVERLAY_FILE": "${sourceDir}/overlay/xiao_ble_sense_devkitv2-adafruit.overlay"
},
{
"name": "build_xiao_ble_sense_devkitv2-adafruit.",
"displayName": "Devkit V2 (with Adafruit BFF Module)",
"configuration": "Debug",
"hidden": false,
"description": "Debug build for devkit v2 device with adafruit audio bff module",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/build_xiao_ble_sense_devkitv2-adafruit",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"CMAKE_BUILD_TYPE": "Debug",
"PLATFORM": "nrf52840",
"BOARD": "xiao_ble_sense",
"CACHED_CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv2-adafruit.conf",
"CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv2-adafruit.conf",
"DTC_OVERLAY_FILE": "${sourceDir}/overlay/xiao_ble_sense_devkitv2-adafruit.overlay"
}
},
{
"name": "build_xiao_ble_sense_devkitv2-5340.",
"displayName": "Devkit V2 (with nrf5340)",
"configuration": "Debug",
"hidden": false,
"description": "Debug build for devkit v2 device with nrf5340",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/build_xiao_ble_sense_devkitv2-5340",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "YES",
"CMAKE_BUILD_TYPE": "Debug",
"PLATFORM": "nrf5340",
"BOARD": "xiao_ble_sense",
"CACHED_CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv2-5340.conf",
"CONF_FILE": "${sourceDir}/prj_xiao_ble_sense_devkitv2-5340.conf",
"DTC_OVERLAY_FILE": "${sourceDir}/overlay/xiao_ble_sense_devkitv2-5340.overlay"
}
}
]
Expand Down
9 changes: 7 additions & 2 deletions Friend/firmware/firmware_v1.0/Kconfig
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
source "Kconfig.zephyr"

menu "Friend Configuration"
menu "Omi Configuration"
config CODEC_OPUS
bool "Opus Audio Codec Support"
default n

config OFFLINE_STORAGE
bool "Offline SD Card Storage Support"
default n
Expand All @@ -17,4 +16,10 @@ config ENABLE_BUTTON
config ENABLE_SPEAKER
bool "Enable the speaker!!"
default n
config ENABLE_LED
bool "Enable the led!!"
default y
config LEGACY_SDK
bool "Using legacy SDK(<=2.7.0)!!"
default y
endmenu
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@

//&i2s0 {
// status = "okay";
// pinctrl-0 = <&i2s0_default>;
// pinctrl-names = "default";
// label = "I2S_0";
//};
//
//&pinctrl {
// i2s0_default: i2s0_default {
// group1 {
// psels = <NRF_PSEL(I2S_SCK_M, 0, 29)>, // SCK pin (bit clock) A3
// <NRF_PSEL(I2S_LRCK_M, 0, 28)>, // LRCK pin (word select clock) A2
// <NRF_PSEL(I2S_SDOUT, 0, 3)>; // SDOUT pin (data out) A1
// };
// };
//};
//
//&spi2 {
// status = "okay";
// pinctrl-0 = <&custom_spi>;
// pinctrl-1 = <&custom_spi>;
// pinctrl-names = "default", "sleep";
// cs-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; // CS pin on P0.28
//
// sdhc0: sdhc@0 {
// compatible = "zephyr,sdhc-spi-slot";
// reg = <0>;
// status = "okay";
// label = "SDHC_0";
// mmc {
// compatible = "zephyr,sdmmc-disk";
// status = "okay";
// };
// spi-max-frequency = <24000000>; // 24 MHz SPI speed for SD card
// };
//};
//
//&pinctrl {
// custom_spi: custom_spi {
// group1 {
// psels = <NRF_PSEL(SPIM_SCK, 1, 13)>, // SCK on P1.13
// <NRF_PSEL(SPIM_MOSI, 1, 15)>, // MOSI on P1.15
// <NRF_PSEL(SPIM_MISO, 1, 14)>; // MISO on P1.14
// };
// };
//};
//
//&uart0 {
// status = "disabled";
//};
//
//// &qspi {
//// status = "disabled";
//// };
//
//&i2c0 {
// lsm6ds3tr_c: lsm6ds3tr-c@6a {
// compatible = "st,lsm6dsl";
// reg = <0x6a>;
// irq-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
// status = "okay";
// label = "b";
// // wakeup-source = true;
// };
//};
//
//&i2c1{
// status = "disabled";
//};
//
//&temp {
// status = "disabled";
//};
//
//


//FOR 7002DK, ref: /opt/nordic/ncs/v2.8.0/zephyr/boards/nordic/nrf7002dk/nrf5340_cpuapp_common.dtsi
/ {
aliases {
led0 = &led0;
led1 = &led1;
led2 = &led1; // Fake led2
pwm-led0 = &pwm_led0;
sw0 = &button0;
sw1 = &button1;
bootloader-led0 = &led0;
mcuboot-button0 = &button0;
mcuboot-led0 = &led0;
watchdog0 = &wdt0;
};
};

// Fake accel
&i2c1 {
lsm6dsl: lsm6dsl@6b {
compatible = "st,lsm6dsl";
reg = <0x6b>;
label = "LSM6DSL";
};
};
Loading

0 comments on commit 4f1a309

Please sign in to comment.