From d03e8974fe05dd55afa9ed60d8af34835fe4ac6c Mon Sep 17 00:00:00 2001 From: Zaven Arra Date: Wed, 10 Jul 2024 18:21:35 -0700 Subject: [PATCH 1/2] use jlink --- platformio.ini | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index b6a6e21..8a02159 100644 --- a/platformio.ini +++ b/platformio.ini @@ -81,6 +81,7 @@ default_envs = NUCLEO-F103RE-ch4-aht-ap debug_port = /dev/ttyACM0 check_tool = cppcheck check_flags = --enable=all + upload_protocol = jlink #RB: ch4 & AHT [env:NUCLEO-F103RB-ch4-aht] platform = ststm32 @@ -268,4 +269,5 @@ default_envs = NUCLEO-F103RE-ch4-aht-ap monitor_speed = 115200 debug_port = /dev/ttyACM0 check_tool = cppcheck - check_flags = --enable=all \ No newline at end of file + check_flags = --enable=all + upload_protocol = jlink \ No newline at end of file From c9aa104b482ef6dba0d9037973ad0d98b67c5c1d Mon Sep 17 00:00:00 2001 From: Zaven Arra Date: Wed, 10 Jul 2024 18:21:58 -0700 Subject: [PATCH 2/2] fix: wrong pin mappings --- src/datalogger.cpp | 5 +++++ src/system/hardware.cpp | 4 ++-- src/system/hardware.h | 6 +++--- src/system/low_power.cpp | 6 +++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/datalogger.cpp b/src/datalogger.cpp index f6a6735..31444f7 100644 --- a/src/datalogger.cpp +++ b/src/datalogger.cpp @@ -1082,6 +1082,11 @@ void Datalogger::powerUpSwitchableComponents() delay(250); enableI2C1(); enableI2C2(); + + debug("turn on exADC"); + pinMode(ENABLE_EXADC, OUTPUT_OPEN_DRAIN); + digitalWrite(ENABLE_EXADC, HIGH); + delay(500); debug("reset exADC"); // Reset external ADC (if it's installed) diff --git a/src/system/hardware.cpp b/src/system/hardware.cpp index 6113261..e7886f6 100644 --- a/src/system/hardware.cpp +++ b/src/system/hardware.cpp @@ -124,8 +124,8 @@ void setupHardwarePins() //pinMode(PA2, OUTPUT); // USART2_TX/ADC12_IN2/TIM2_CH3 //pinMode(PA3, INPUT); // USART2_RX/ADC12_IN3/TIM2_CH4 - pinMode(PC5, OUTPUT); // external ADC reset - digitalWrite(PC5, HIGH); + pinMode(EXADC_RESET, OUTPUT); // external ADC reset + digitalWrite(EXADC_RESET, HIGH); } int getBatteryValue() diff --git a/src/system/hardware.h b/src/system/hardware.h index f4ff206..795f243 100644 --- a/src/system/hardware.h +++ b/src/system/hardware.h @@ -31,7 +31,7 @@ // extern TwoWire WireTwo; #define WireTwo Wire1 -#define SWITCHED_POWER_ENABLE PC6 +#define SWITCHED_POWER_ENABLE PC5 #define SD_ENABLE_PIN PC8 #define BLE_COMMAND_MODE_PIN PB5 @@ -75,8 +75,8 @@ //A2-A6 work as GPIO, currently used - -#define EXADC_RESET PC5 +#define ENABLE_EXADC PC6 +#define EXADC_RESET PA4 // Bluefruit on SPI #define BLUEFRUIT_SPI_SCK PB13 diff --git a/src/system/low_power.cpp b/src/system/low_power.cpp index ffc006f..a825635 100644 --- a/src/system/low_power.cpp +++ b/src/system/low_power.cpp @@ -212,8 +212,8 @@ void hardwarePinsAlwaysOff() // not currently used pinMode(PB15, INPUT); pinMode(PC4, INPUT); - // pinMode(PC5, INPUT); // external ADC reset - // pinMode(PC6, INPUT); // this is the switch power pin + // pinMode(PC5, INPUT); // external ADC reset WRONG + // pinMode(PC6, INPUT); // this is the switch power pin WRONG pinMode(PC9, INPUT); pinMode(PC10, INPUT); @@ -342,7 +342,7 @@ void restorePinDefaults() pinMode(PC2, OUTPUT); // ADC12_IN12 pinMode(PC3, OUTPUT); // ADC12_IN13 pinMode(PC4, OUTPUT); // ADC12_IN14 - pinMode(PC5, OUTPUT); // External ADC Reset (ADC_RESET_PC5) + pinMode(PC5, OUTPUT); // External ADC Reset (ADC_RESET_PC5) WRONG pinMode(PC6, OUTPUT); pinMode(PC7, OUTPUT); pinMode(PC8, OUTPUT);