Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
40d846e
Squashed commit of the following:
MedadRufus Nov 21, 2022
b66021e
deal with bsp
MedadRufus Nov 21, 2022
822ff41
nearly there
MedadRufus Nov 21, 2022
87bf4de
Update config.h
MedadRufus Nov 21, 2022
ef06882
less verbose
MedadRufus Nov 21, 2022
5735de2
Update bsp.c
MedadRufus Nov 21, 2022
c90e733
115200 baud
MedadRufus Nov 23, 2022
4fce567
old fifo size
MedadRufus Nov 23, 2022
edc8fd9
Revert "115200 baud"
MedadRufus Nov 26, 2022
a165385
Update config.h
MedadRufus Nov 26, 2022
95f3674
handle incoming better
MedadRufus Nov 26, 2022
8dfc37b
Update bsp.c
MedadRufus Nov 26, 2022
51598a7
overhaul
MedadRufus Nov 28, 2022
33724b5
Update bsp.c
MedadRufus Nov 28, 2022
5e8f438
Update bsp.c
MedadRufus Nov 28, 2022
b7576ab
Update bsp.c
MedadRufus Nov 28, 2022
4bae663
Update bsp.c
MedadRufus Nov 28, 2022
d5d1d44
Update bsp.c
MedadRufus Nov 28, 2022
dd91970
Update bsp.c
MedadRufus Nov 28, 2022
e9f5a6d
Update ublox.c
MedadRufus Nov 28, 2022
e143497
Update bsp.c
MedadRufus Nov 28, 2022
02de3c6
Update bsp.c
MedadRufus Nov 28, 2022
016a702
Update bsp.c
MedadRufus Nov 28, 2022
d0e7e41
Update board-config.h
MedadRufus Nov 28, 2022
31a65f3
Update uart-board.c
MedadRufus Nov 28, 2022
821da94
Revert "Update uart-board.c"
MedadRufus Nov 28, 2022
b325bf1
put in NAMote72 code
MedadRufus Nov 28, 2022
7b84c5d
Update board.c
MedadRufus Nov 28, 2022
86d7ce1
Update board-config.h
MedadRufus Nov 28, 2022
aae1301
Create gps-board.c
MedadRufus Nov 28, 2022
dba8bb8
Update uart-board.c
MedadRufus Nov 28, 2022
b03ce2d
Update board.c
MedadRufus Nov 28, 2022
ac69323
ok
MedadRufus Nov 28, 2022
0e14c77
Update uart-board.c
MedadRufus Nov 28, 2022
607471e
Update periodic-uplink-lpp.uvprojx
MedadRufus Nov 28, 2022
e83765d
getting there
MedadRufus Nov 28, 2022
a47d2be
Update gps-board.c
MedadRufus Nov 28, 2022
a6e35c2
Update bsp.c
MedadRufus Nov 28, 2022
7e72aa2
Update i2c_middleware.c
MedadRufus Nov 28, 2022
b7049f2
Update board.c
MedadRufus Nov 28, 2022
5630d65
delete more
MedadRufus Nov 28, 2022
11d58a4
Update gps-board.c
MedadRufus Nov 28, 2022
3e97b17
Update board-config.h
MedadRufus Nov 28, 2022
805364b
Squashed commit of the following:
MedadRufus Nov 28, 2022
8f787b5
Update ublox.c
MedadRufus Nov 28, 2022
0162b0b
rx and tx GPS
MedadRufus Nov 29, 2022
65e85d7
delete old gps files
MedadRufus Nov 29, 2022
1160842
delete ublox references
MedadRufus Nov 29, 2022
02ea9c7
use native gps library
MedadRufus Nov 29, 2022
42f64fd
Update bsp.c
MedadRufus Nov 29, 2022
ece62e1
Update callbacks.c
MedadRufus Nov 29, 2022
cd3d336
compromat - use old gps structure
MedadRufus Nov 29, 2022
da88381
put back no load solarvoltage with dummy
MedadRufus Nov 29, 2022
d1e3d2e
delete redundant.
MedadRufus Nov 29, 2022
2735a79
read from native gps structure
MedadRufus Nov 29, 2022
560bf33
configure correctly
MedadRufus Nov 29, 2022
8de96b0
don't endless loop
MedadRufus Nov 29, 2022
11cb10f
pass on data from GPS
MedadRufus Nov 29, 2022
b2693d0
Add another passthrough
MedadRufus Nov 29, 2022
0f52096
Update board.h
MedadRufus Nov 29, 2022
0c46cca
bug
MedadRufus Nov 29, 2022
08dc952
use simpler callback
MedadRufus Nov 29, 2022
f45e366
use UBX only
MedadRufus Nov 29, 2022
13f5f43
1 stop bit
MedadRufus Nov 29, 2022
6220a20
works to shut non ubx out
MedadRufus Nov 29, 2022
76bdc40
wait 4 startup
MedadRufus Nov 29, 2022
fc75a88
working solution
MedadRufus Nov 29, 2022
c3ca578
simpler
MedadRufus Nov 29, 2022
e87b35a
Revert "simpler"
MedadRufus Nov 29, 2022
3dc082a
Create db_dump.txt
MedadRufus Nov 29, 2022
b1a0bc3
works at 9600 baud
MedadRufus Nov 30, 2022
670c0f4
Revert "Revert "simpler""
MedadRufus Nov 30, 2022
80a4631
delete i2c
MedadRufus Nov 30, 2022
163774f
Update periodic-uplink-lpp.uvprojx
MedadRufus Nov 30, 2022
fdfe210
Delete db_dump.txt
MedadRufus Nov 30, 2022
073c0ef
Update .gitignore
MedadRufus Nov 30, 2022
1df930a
revert useless changes
MedadRufus Nov 30, 2022
b403c35
Update bsp.c
MedadRufus Nov 30, 2022
8c06e93
delete ublox mocks
MedadRufus Nov 30, 2022
373088a
formatting
MedadRufus Nov 30, 2022
93399f5
Revert "Up tx count only after final rx"
MedadRufus Dec 1, 2022
b44c3e2
Update main.c
MedadRufus Dec 1, 2022
01a0bf6
delete gps turn back on
MedadRufus Dec 1, 2022
e5a8468
Revert "delete old gps files"
MedadRufus Dec 1, 2022
afeb981
remove my ublox lib
MedadRufus Dec 1, 2022
83c0190
autoformat to vscode style
MedadRufus Dec 1, 2022
14ba164
delete lots of unncessary stuff
MedadRufus Dec 1, 2022
edb8a2f
delete unused stuff
MedadRufus Dec 5, 2022
fc0de03
add back gps
MedadRufus Dec 5, 2022
4a9d6ed
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
461efa8
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
2656776
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
a5f3e65
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
aca760d
delete more rtcm
MedadRufus Dec 5, 2022
89fc6dd
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
c7679e2
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
24b2bf7
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
2130fde
use standardised parser
MedadRufus Dec 5, 2022
7b2008f
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
1dbbb47
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
696834c
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
9c3b534
Revert "Update SparkFun_Ublox_Arduino_Library.c"
MedadRufus Dec 5, 2022
10daf8c
Revert "Update SparkFun_Ublox_Arduino_Library.c"
MedadRufus Dec 5, 2022
70676fe
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 5, 2022
8b43fd3
struct
MedadRufus Dec 5, 2022
4c25400
formatting and curly after if
MedadRufus Dec 5, 2022
67e5917
delete stuff
MedadRufus Dec 5, 2022
0bdb11b
Update SparkFun_Ublox_Arduino_Library.h
MedadRufus Dec 5, 2022
6a0408f
seperate file for constatnts
MedadRufus Dec 5, 2022
5952b17
cleanup
MedadRufus Dec 5, 2022
7551b34
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 6, 2022
2e56c5d
expose interface functions
MedadRufus Dec 6, 2022
5be70a4
reset
MedadRufus Dec 6, 2022
7d1d306
cleanup
MedadRufus Dec 6, 2022
f97094d
Update SparkFun_Ublox_Arduino_Library.h
MedadRufus Dec 6, 2022
dc9c850
Update SparkFun_Ublox_Arduino_Library.h
MedadRufus Dec 6, 2022
464b528
Update SparkFun_Ublox_Arduino_Library.h
MedadRufus Dec 6, 2022
d973d10
Update SparkFun_Ublox_Arduino_Library.h
MedadRufus Dec 6, 2022
d8b53bf
Update SparkFun_Ublox_Arduino_Library.h
MedadRufus Dec 6, 2022
15e6e2b
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 6, 2022
166f0a5
Update SparkFun_Ublox_Arduino_Library.c
MedadRufus Dec 6, 2022
d49d8b6
rename files
MedadRufus Dec 6, 2022
a90092a
Delete ublox_constants.h
MedadRufus Dec 6, 2022
87052be
Update struct.h
MedadRufus Dec 6, 2022
57f5ca5
Update ublox.c
MedadRufus Dec 6, 2022
39abeb6
do send down string
MedadRufus Dec 6, 2022
5bd1d6e
don't parse NMEA - only parse UBX
MedadRufus Dec 6, 2022
2f60f9b
get current info
MedadRufus Dec 6, 2022
cd54168
continue
MedadRufus Dec 6, 2022
1cfbbf3
add in time
MedadRufus Dec 6, 2022
2de5f61
Update ublox.c
MedadRufus Dec 6, 2022
7959ad8
Update bsp.c
MedadRufus Dec 6, 2022
6822674
position
MedadRufus Dec 6, 2022
02f7502
Update ublox.c
MedadRufus Dec 6, 2022
2813e64
rename variable
MedadRufus Dec 6, 2022
34a4f5d
move processing inside
MedadRufus Dec 6, 2022
f756dff
process ublox
MedadRufus Dec 6, 2022
821e09f
reset to null values
MedadRufus Dec 6, 2022
9f56cf0
Update ublox.c
MedadRufus Dec 6, 2022
c06d8bc
Add gps checker timer
MedadRufus Dec 6, 2022
794b27d
reorganise
MedadRufus Dec 6, 2022
0893372
static
MedadRufus Dec 6, 2022
0de39bf
frame count zero
MedadRufus Dec 6, 2022
d560632
Update ublox.c
MedadRufus Dec 6, 2022
b903a3e
add in essential check
MedadRufus Dec 6, 2022
438ac04
request from outside
MedadRufus Dec 7, 2022
391e093
use defines for size
MedadRufus Dec 7, 2022
8eb0260
remove GPS timer
MedadRufus Dec 7, 2022
e40cc2b
Revert "remove GPS timer"
MedadRufus Dec 7, 2022
da90a61
Enable hardfault handler
MedadRufus Dec 8, 2022
7d4ea54
Issue #1086 - Fixed HardFault_Handler for Cortex-M0 targets
mluis1 Oct 25, 2022
1a70988
Create hard_fault_handler.s
MedadRufus Dec 8, 2022
945ac6f
add in hard fault handler
MedadRufus Dec 8, 2022
15ef404
simple approach
MedadRufus Dec 8, 2022
7aba1d8
getting close
MedadRufus Dec 8, 2022
5c588ff
Update startup_stm32l072xx.s
MedadRufus Dec 8, 2022
a3bb54d
copy known good code
MedadRufus Dec 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ ipch/
:50003
:50006
.vscode/.cortex-debug.peripherals.state.json
db_dump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls></MiscControls>
<Define>USE_HAL_DRIVER STM32L072xx REGION_AS923 REGION_AU915 REGION_CN470 REGION_EU868 REGION_KR920 REGION_IN865 REGION_US915 REGION_RU864 LORAMAC_CLASSB_ENABLED USE_RADIO_DEBUG SOFT_SE</Define>
<Define>USE_HAL_DRIVER STM32L072xx REGION_AS923 REGION_AU915 REGION_CN470 REGION_EU868 REGION_KR920 REGION_IN865 REGION_US915 REGION_RU864 LORAMAC_CLASSB_ENABLED USE_RADIO_DEBUG SOFT_SE HARD_FAULT_HANDLER_ENABLED</Define>
<Undefine></Undefine>
<IncludePath>..\..\..\..\src;..\..\..\..\src\apps\LoRaMac\periodic-uplink-lpp\B-L072Z-LRWAN1;..\..\..\..\src\apps\LoRaMac\common;..\..\..\..\src\apps\LoRaMac\common\LmHandler;..\..\..\..\src\apps\LoRaMac\common\LmHandler\packages;..\..\..\..\src\boards;..\..\..\..\src\boards\B-L072Z-LRWAN1;..\..\..\..\src\boards\B-L072Z-LRWAN1\cmsis;..\..\..\..\src\boards\mcu\stm32;..\..\..\..\src\boards\mcu\stm32\cmsis;..\..\..\..\src\boards\mcu\stm32\STM32L0xx_HAL_Driver\inc;..\..\..\..\src\apps\LoRaMac\common;..\..\..\..\src\mac;..\..\..\..\src\mac\region;..\..\..\..\src\peripherals;..\..\..\..\src\peripherals\soft-se;..\..\..\..\src\radio;..\..\..\..\src\system;..\..\..\..\src\system\crypto</IncludePath>
</VariousControls>
Expand Down Expand Up @@ -528,6 +528,21 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\src\boards\B-L072Z-LRWAN1\adc-board.c</FilePath>
</File>
<File>
<FileName>gps-board.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\src\boards\B-L072Z-LRWAN1\gps-board.c</FilePath>
</File>
<File>
<FileName>sysIrqHandlers.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\src\boards\B-L072Z-LRWAN1\sysIrqHandlers.c</FilePath>
</File>
<File>
<FileName>hard_fault_handler.s</FileName>
<FileType>2</FileType>
<FilePath>..\..\..\..\src\boards\B-L072Z-LRWAN1\hard_fault_handler.s</FilePath>
</File>
</Files>
</Group>
<Group>
Expand Down Expand Up @@ -813,16 +828,6 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\src\peripherals\LoRaWAN_config_switcher.c</FilePath>
</File>
<File>
<FileName>SparkFun_Ublox_Arduino_Library.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\src\peripherals\SparkFun_Ublox_Arduino_Library.c</FilePath>
</File>
<File>
<FileName>ublox.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\src\peripherals\ublox.c</FilePath>
</File>
<File>
<FileName>playback.c</FileName>
<FileType>1</FileType>
Expand All @@ -834,14 +839,14 @@
<FilePath>..\..\..\..\src\peripherals\struct.c</FilePath>
</File>
<File>
<FileName>i2c_middleware.c</FileName>
<FileName>eeprom_settings_manager.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\src\peripherals\i2c_middleware.c</FilePath>
<FilePath>..\..\..\..\src\peripherals\eeprom_settings_manager.c</FilePath>
</File>
<File>
<FileName>eeprom_settings_manager.c</FileName>
<FileName>ublox.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\src\peripherals\eeprom_settings_manager.c</FilePath>
<FilePath>..\..\..\..\src\peripherals\ublox.c</FilePath>
</File>
</Files>
</Group>
Expand Down Expand Up @@ -928,6 +933,11 @@
<FileType>1</FileType>
<FilePath>..\..\..\..\src\system\adc.c</FilePath>
</File>
<File>
<FileName>gps.c</FileName>
<FileType>1</FileType>
<FilePath>..\..\..\..\src\system\gps.c</FilePath>
</File>
</Files>
</Group>
</Groups>
Expand Down
16 changes: 5 additions & 11 deletions src/apps/LoRaMac/common/callbacks.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <stdlib.h>
#include "NvmDataMgmt.h"
#include "string.h"
#include "ublox.h"
#include "soft-se-hal.h"
#include "nvmm.h"
#include "struct.h"
Expand All @@ -40,19 +39,14 @@ void OnNvmDataChange(LmHandlerNvmContextStates_t state, uint16_t size)
DisplayNvmDataChange(state, size);

/**
* @brief This is the last event in a Class A transmission, as the last
* @brief Only turn back on the GPS during the Store function call. This is the last
* event in a Class A transmission, so its now safe to turn back on the GPS. The last
* RX window has closed by now.
*
*/
if (state == LORAMAC_HANDLER_NVM_STORE)
{
tx_count_on_this_credential++;
#if GPS_ENABLED
/**
* Setup GPS again after all radio events(TX, RX) are complete,
* just in case the GPS lost power during radio transmissions.
*/
setup_GPS();
#endif
}
}

Expand Down Expand Up @@ -225,8 +219,8 @@ void OnRxData(LmHandlerAppData_t *appData, LmHandlerRxParams_t *params)
printf("Received data to WIPE EEPROM: ");
print_bytes(appData->Buffer, appData->BufferSize);

uint32_t start = extractLong_from_buff(0, appData->Buffer);
uint32_t end = extractLong_from_buff(4, appData->Buffer);
uint32_t start = extractLong(0, appData->Buffer);
uint32_t end = extractLong(4, appData->Buffer);

IWDG_reset();
EEPROM_Wipe(start, end);
Expand Down
48 changes: 47 additions & 1 deletion src/apps/LoRaMac/periodic-uplink-lpp/B-L072Z-LRWAN1/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "Commissioning.h"

#include "config.h"
#include "ublox.h"
#include "geofence.h"
#include "iwdg.h"
#include "print_utils.h"
Expand All @@ -38,6 +37,7 @@
#include "message_sender.h"
#include "eeprom_settings_manager.h"
#include "nvmm.h"
#include "ublox.h"

#ifdef UNITTESTING_LORA
#include "rtc_mock.h"
Expand All @@ -63,17 +63,29 @@ static LmHandlerAppData_t AppData =
*/
static TimerEvent_t TxTimer;

/*!
* Timer to handle the state of GpsChecker
*/
static TimerEvent_t GpsCheckerTimer;

static void OnMacProcessNotify( void );
static void timer_init( void );
static void UplinkProcess( void );
static void transmit_n_times_on_this_credential( void );
static void setup_next_tx_alarm( uint32_t interval );
static void GpsProcess( void );

/*!
* Function executed on TxTimer event
*/
static void OnTxTimerEvent( void* context );

/*!
* Function executed when its time to check GPS
*/
static void OnGpsCheckerTimerEvent( void* context );


static LmHandlerCallbacks_t LmHandlerCallbacks =
{
.GetBatteryLevel = BoardGetBatteryLevel,
Expand Down Expand Up @@ -120,6 +132,7 @@ static volatile uint8_t IsMacProcessPending = 0;

static volatile uint8_t IsTxFramePending = 0;

static volatile uint8_t IsGpsCheckPending = 0;
/*!
* UART object used for command line interface handling
*/
Expand All @@ -145,6 +158,10 @@ int main( void )
printf( "\n" );
#endif

TimerInit( &GpsCheckerTimer, OnGpsCheckerTimerEvent );
TimerSetValue( &GpsCheckerTimer, 1000 );
TimerStart( &GpsCheckerTimer );

/* Initialise timer */
timer_init( );

Expand Down Expand Up @@ -212,6 +229,9 @@ static void transmit_n_times_on_this_credential( void )
// Process application uplinks management
UplinkProcess( );

// Process GPS
GpsProcess( );

CRITICAL_SECTION_BEGIN( );
if( IsMacProcessPending == 1 )
{
Expand Down Expand Up @@ -291,3 +311,29 @@ static void timer_init( )
TimerInit( &TxTimer, OnTxTimerEvent );
TimerStop( &TxTimer );
}

static void GpsProcess( void )
{
uint8_t isPending = 0;
CRITICAL_SECTION_BEGIN( );
isPending = IsGpsCheckPending;
IsGpsCheckPending = 0;
CRITICAL_SECTION_END( );
if( isPending == 1 )
{
request_gps_fix( );
}
}

/*!
* Function executed on GPS Check Timeout event
*/
static void OnGpsCheckerTimerEvent( void* context )
{
TimerStop( &GpsCheckerTimer );

IsGpsCheckPending = 1;

TimerSetValue( &GpsCheckerTimer, 1000 );
TimerStart( &GpsCheckerTimer );
}
10 changes: 7 additions & 3 deletions src/boards/B-L072Z-LRWAN1/board-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ extern "C"
#define LED_3 PB_6
#define LED_4 PB_7
#define GPS_INT PB_13
#define LOAD_ENABLE PA_11

#define LED_GREEN LED_1
#define LED_RED1 LED_2
Expand All @@ -93,8 +92,13 @@ extern "C"
#define I2C_SCL PB_8
#define I2C_SDA PB_9

#define UART_TX PA_9
#define UART_RX PA_10
#define GPS_POWER_ON PA_11
#define GPS_PPS PB_14
#define GPS_UART_TX PA_2
#define GPS_UART_RX PA_3

#define UART1_TX PA_9
#define UART1_RX PA_10

// Debug pins definition.
#define RADIO_DBG_PIN_TX PB_13
Expand Down
27 changes: 21 additions & 6 deletions src/boards/B-L072Z-LRWAN1/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "delay.h"
#include "iwdg.h"
#include "string.h"
#include "gps.h"

#include "stm32l0xx_ll_adc.h"

Expand All @@ -63,7 +64,6 @@
Gpio_t Led1;

Gpio_t Gps_int;
Gpio_t Load_enable;

Gpio_t i2c_scl;
Gpio_t i2c_sda;
Expand All @@ -72,6 +72,7 @@ Gpio_t i2c_sda;
* MCU objects
*/
Uart_t Uart1;
Uart_t Uart2;
I2c_t I2c;
Adc_t Adc;

Expand Down Expand Up @@ -101,7 +102,6 @@ static void CalibrateSystemWakeupTime( void );
*/
static void SystemClockReConfig( void );


/*!
* Timer used at first boot to calibrate the SystemWakeupTime
*/
Expand All @@ -121,7 +121,7 @@ static bool UsbIsConnected = false;
* UART1 FIFO buffers size
*/
#define UART1_FIFO_TX_SIZE 1024
#define UART1_FIFO_RX_SIZE 50 // We should hardly expect any rx data at all. Max 2-3 bytes
#define UART1_FIFO_RX_SIZE 1024 // We should hardly expect any rx data at all. Max 2-3 bytes

uint8_t Uart1TxBuffer[UART1_FIFO_TX_SIZE];
uint8_t Uart1RxBuffer[UART1_FIFO_RX_SIZE];
Expand Down Expand Up @@ -153,6 +153,8 @@ void BoardCriticalSectionEnd( uint32_t *mask )

void BoardInitPeriph( void )
{

GpsInit( );
BSP_sensor_Init();
}

Expand All @@ -171,7 +173,6 @@ void BoardInitMcu( void )
GpioInit( &Led1, LED_1, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );

// Load enable for sensors, GPS
GpioInit( &Load_enable, LOAD_ENABLE, PIN_OUTPUT, PIN_PUSH_PULL, PIN_NO_PULL, 1 );
SystemClockConfig( );

#if DEEP_SLEEP_ENABLE
Expand All @@ -182,9 +183,11 @@ void BoardInitMcu( void )

FifoInit( &Uart1.FifoTx, Uart1TxBuffer, UART1_FIFO_TX_SIZE );
FifoInit( &Uart1.FifoRx, Uart1RxBuffer, UART1_FIFO_RX_SIZE );
Uart1.IrqNotify = HostMcuIrqNotify;

// Configure your terminal for 8 Bits data (7 data bit + 1 parity bit), no parity and no flow ctrl
UartInit( &Uart1, UART_1, UART_TX, UART_RX );
UartConfig( &Uart1, RX_TX, 2000000, UART_8_BIT, UART_1_STOP_BIT, NO_PARITY, NO_FLOW_CTRL );
UartInit( &Uart1, UART_1, UART1_TX, UART1_RX );
UartConfig( &Uart1, RX_TX, 9600, UART_8_BIT, UART_1_STOP_BIT, NO_PARITY, NO_FLOW_CTRL );

I2cInit( &I2c, I2C_1, I2C_SCL, I2C_SDA );

Expand Down Expand Up @@ -546,3 +549,15 @@ void assert_failed( uint8_t* file, uint32_t line )
}
}
#endif

void HostMcuIrqNotify(UartNotifyId_t id)
{
uint8_t data;
if (id == UART_NOTIFY_RX)
{
if (UartGetChar(&Uart1, &data) == 0)
{
UartPutChar(&Uart2, data);
}
}
}
17 changes: 15 additions & 2 deletions src/boards/B-L072Z-LRWAN1/cmsis/arm-std/startup_stm32l072xx.s
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,23 @@ NMI_Handler PROC
EXPORT NMI_Handler [WEAK]
B .
ENDP

HardFault_Handler\
PROC
EXPORT HardFault_Handler [WEAK]
B .
EXPORT HardFault_Handler [WEAK]
IMPORT HardFault_Handler_C
MOVS r0, #4
MOV r1, LR
TST r0, r1
BEQ stacking_used_MSP
MRS R0, PSP ; first parameter - stacking was using PSP
B get_LR_and_branch
stacking_used_MSP
MRS R0, MSP ; first parameter - stacking was using MSP
get_LR_and_branch
MOV R1, LR ; second parameter is LR current value
LDR R2,=HardFault_Handler_C
BX R2
ENDP
SVC_Handler PROC
EXPORT SVC_Handler [WEAK]
Expand Down
Loading