1
0
mirror of https://github.com/peterantypas/maiana.git synced 2025-05-16 07:20:08 -07:00

Board 11.0 bringup complete

This commit is contained in:
Peter Antypas 2021-08-23 20:57:10 -07:00
parent bcefcc5ca9
commit 9af0e90a1d
7 changed files with 46 additions and 22 deletions

View File

@ -1428,8 +1428,6 @@ void SetN2kPGN129810(tN2kMsg &N2kMsg, uint8_t MessageID, tN2kAISRepeat Repeat, u
N2kMsg.Add2ByteUDouble(PosRefBow, 0.1);
N2kMsg.Add4ByteUInt(MothershipID);
N2kMsg.AddByte(0xff); // Reserved
// TODO: Add AIS Transceiver Info here!!!
N2kMsg.AddByte(AISInfo);
}
@ -1758,7 +1756,7 @@ bool ParseN2kPGN129041(const tN2kMsg &N2kMsg, uint8_t &MessageID, tN2kAISRepeat
bool &OffPos, bool &Virtual, bool &AssignedMode, tN2kGNSStype &GNSSType,
tN2kAISTranceiverInfo &AISinfo)
{
if (N2kMsg.PGN != 129049L) return false;
if (N2kMsg.PGN != 129041L) return false;
uint8_t vb;
int Index = 0;

View File

@ -1233,12 +1233,12 @@ void SetN2kPGN129794(tN2kMsg &N2kMsg, uint8_t MessageID, tN2kAISRepeat Repeat, u
uint32_t IMOnumber, const char *Callsign, const char *Name, uint8_t VesselType, double Length,
double Beam, double PosRefStbd, double PosRefBow, uint16_t ETAdate, double ETAtime,
double Draught, const char *Destination, tN2kAISVersion AISversion, tN2kGNSStype GNSStype,
tN2kAISDTE DTE, tN2kAISTranceiverInfo AISinfo);
tN2kAISDTE DTE, tN2kAISTranceiverInfo AISinfo = N2kaisti_Reserved);
inline void SetN2kAISClassAStatic(tN2kMsg &N2kMsg, uint8_t MessageID, tN2kAISRepeat Repeat, uint32_t UserID,
uint32_t IMOnumber, const char *Callsign, const char *Name, uint8_t VesselType, double Length,
double Beam, double PosRefStbd, double PosRefBow, uint16_t ETAdate, double ETAtime,
double Draught, const char *Destination, tN2kAISVersion AISversion, tN2kGNSStype GNSStype,
tN2kAISDTE DTE, tN2kAISTranceiverInfo AISinfo) {
tN2kAISDTE DTE, tN2kAISTranceiverInfo AISinfo = N2kaisti_Reserved) {
SetN2kPGN129794(N2kMsg, MessageID, Repeat, UserID, IMOnumber, Callsign, Name, VesselType, Length,
Beam, PosRefStbd, PosRefBow, ETAdate, ETAtime, Draught, Destination, AISversion, GNSStype, DTE, AISinfo);
}
@ -1580,7 +1580,7 @@ void SetN2kPGN129041(tN2kMsg &N2kMsg, uint8_t MessageID, tN2kAISRepeat Repeat, u
tN2kAtoNType type, const char *Name,
double Length, double Beam, double PosRefStbd, double PosRefBow,
bool OffPos, bool Virtual, bool AssignedMode, tN2kGNSStype GNSSType,
tN2kAISTranceiverInfo AISinfo);
tN2kAISTranceiverInfo AISinfo = N2kaisti_Reserved);
bool ParseN2kPGN129041(const tN2kMsg &N2kMsg, uint8_t &MessageID, tN2kAISRepeat &Repeat, uint32_t &UserID,
double &Latitude, double &Longitude, bool &Accuracy, bool &RAIM,

View File

@ -2,15 +2,23 @@
This is a vanilla Eclipse CDT project. Import it into your workspace and (assuming you have ARM cross compiler installed) it should be straightforward.
The application is mainly interrupt driven, with a single event queue being dispatched by either main() or an RTOS task.
The application is mainly interrupt driven, with an event queue being dispatched by main().
### Key updates
- It turned out that FreeRTOS added no value, so it was removed
- DFU can be achieved by jumping directly into the ROM bootloader, so there is no need for hardware to manipulate the BOOT0 pin
- The TX_DISABLE signal is now supported. It is active low in board 9.x and active high in board 10.x
- The TX_DISABLE signal is now supported. It is active low in board 9.x and active high in board 10.x and higher
- Board 9.3 adds 3 "status" (LED driving) signals for GPS, RX and TX
- Board 10.x needed a GPIO swap to make routing viable and inverted the logic of the TX_DISABLE signal, but it's all abstracted in the BSP
- The new 'cli' command was introduced to reboot the board into 'quiet' mode, making it a lot easier to program and verify the station data
- Station metadata is now stored in MCU flash, so it is handled in the Configuration class instead of the BSP. The EEPROM is obsolete.
### Building and flashing
You will need Eclipse CDT with the MCU package, plus the ARM GCC crosscompiler toolkit. You may need to tweak toolkit paths for the build to work.
The project supports the following STM32 MCUs: L412, L422, L431 and L432.
The openocd-flash-*** scripts in this folder can be run against an STLink programmer to flash the corresponding binary directly to the MCU without any kind of Debug session in Eclipse.

View File

@ -74,6 +74,8 @@ static const GPIO __gpios[] = {
{RX_IC_CLK_PORT, {RX_IC_CLK_PIN, GPIO_MODE_IT_RISING, GPIO_NOPULL, GPIO_SPEED_LOW, 0}, GPIO_PIN_RESET},
{RX_IC_DATA_PORT, {RX_IC_DATA_PIN, GPIO_MODE_INPUT, GPIO_NOPULL, GPIO_SPEED_LOW, 0}, GPIO_PIN_RESET},
{PA_BIAS_PORT, {PA_BIAS_PIN, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_SPEED_LOW, 0}, GPIO_PIN_RESET},
{LNA_PWR_PORT, {LNA_PWR_PIN, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_SPEED_LOW, 0}, GPIO_PIN_RESET},
{RFSW_CTRL_PORT, {RFSW_CTRL_PIN, GPIO_MODE_OUTPUT_PP, GPIO_NOPULL, GPIO_SPEED_LOW, 0}, GPIO_PIN_RESET},
};
extern "C"
@ -197,8 +199,6 @@ void bsp_hw_init()
HAL_NVIC_SetPriority(EXTI3_IRQn, 1, 0);
HAL_NVIC_EnableIRQ(EXTI3_IRQn);
// This is our HAL tick timer now
HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 0, 0);
}
@ -273,12 +273,11 @@ void gpio_pin_init()
for ( unsigned i = 0; i < sizeof __gpios / sizeof(GPIO); ++i )
{
const GPIO* io = &__gpios[i];
HAL_GPIO_Init(io->port, (GPIO_InitTypeDef*)&io->gpio);
if ( io->gpio.Mode == GPIO_MODE_OUTPUT_PP || io->gpio.Mode == GPIO_MODE_OUTPUT_OD )
{
HAL_GPIO_WritePin(io->port, io->gpio.Pin, io->init);
}
HAL_GPIO_Init(io->port, (GPIO_InitTypeDef*)&io->gpio);
}
}
@ -321,13 +320,15 @@ void HAL_MspInit(void)
void bsp_set_rx_mode()
{
HAL_GPIO_WritePin(PA_BIAS_PORT, PA_BIAS_PIN, GPIO_PIN_RESET); // Kill the RF MOSFET bias voltage
GPIO_InitTypeDef gpio;
gpio.Pin = TRX_IC_DATA_PIN;
gpio.Mode = GPIO_MODE_INPUT;
gpio.Speed = GPIO_SPEED_FREQ_LOW;
gpio.Pull = GPIO_NOPULL;
HAL_GPIO_Init(TRX_IC_DATA_PORT, &gpio);
HAL_GPIO_WritePin(LNA_PWR_PORT, LNA_PWR_PIN, GPIO_PIN_SET);
HAL_GPIO_WritePin(RFSW_CTRL_PORT, RFSW_CTRL_PIN, GPIO_PIN_RESET);
}
void bsp_rx_led_on()
@ -363,6 +364,9 @@ void bsp_gps_led_off()
void bsp_set_tx_mode()
{
HAL_GPIO_WritePin(LNA_PWR_PORT, LNA_PWR_PIN, GPIO_PIN_RESET);
HAL_GPIO_WritePin(RFSW_CTRL_PORT, RFSW_CTRL_PIN, GPIO_PIN_SET);
GPIO_InitTypeDef gpio;
gpio.Pin = TRX_IC_DATA_PIN;
gpio.Mode = GPIO_MODE_OUTPUT_PP;

View File

@ -1,8 +0,0 @@
device STM32L432KB
si 1
speed 1000
connect
loadbin Release/ais_transponder.bin, 0x08000000
r
g
q

View File

@ -0,0 +1,22 @@
source [find interface/stlink.cfg]
transport select hla_swd
source [find target/stm32l4x.cfg]
adapter speed 950
#reset_config srst_nogate
#adapter srst delay 100
#adapter srst pulse_width 100
init
#targets
reset init
reset halt
flash write_image erase "STM32L431-Release/maiana-transponder.bin" 0x08000000
wait 5
verify_image "STM32L431-Release/maiana-transponder.bin" 0x08000000 bin
reset run
shutdown

View File

@ -1,4 +1,4 @@
source [find interface/stlink.cfg]
TRX_IC_CLK_PINsource [find interface/stlink.cfg]
transport select hla_swd
source [find target/stm32l4x.cfg]