sysmocom_rfdsatt: Actuall "port" over to our target

This patch changes whatever is different bethween the Olimex P103 and
the sysmocom rfdsatt board
This commit is contained in:
Harald Welte 2021-03-28 17:29:27 +02:00
parent d53374daa0
commit 3a352025f9
5 changed files with 22 additions and 15 deletions

View File

@ -46,7 +46,7 @@
/** \brief Frequency of the external crystal oscillator. */ /** \brief Frequency of the external crystal oscillator. */
#define BOOT_CPU_XTAL_SPEED_KHZ (8000) #define BOOT_CPU_XTAL_SPEED_KHZ (8000)
/** \brief Desired system speed. */ /** \brief Desired system speed. */
#define BOOT_CPU_SYSTEM_SPEED_KHZ (72000) #define BOOT_CPU_SYSTEM_SPEED_KHZ (36000)
/** \brief Motorola or Intel style byte ordering. */ /** \brief Motorola or Intel style byte ordering. */
#define BOOT_CPU_BYTE_ORDER_MOTOROLA (0) #define BOOT_CPU_BYTE_ORDER_MOTOROLA (0)
/** \brief Enable/disable hook function call right before user program start. */ /** \brief Enable/disable hook function call right before user program start. */
@ -70,7 +70,7 @@
* *
*/ */
/** \brief Enable/disable CAN transport layer. */ /** \brief Enable/disable CAN transport layer. */
#define BOOT_COM_CAN_ENABLE (1) #define BOOT_COM_CAN_ENABLE (0)
/** \brief Configure the desired CAN baudrate. */ /** \brief Configure the desired CAN baudrate. */
#define BOOT_COM_CAN_BAUDRATE (500000) #define BOOT_COM_CAN_BAUDRATE (500000)
/** \brief Configure CAN message ID target->host. */ /** \brief Configure CAN message ID target->host. */
@ -95,7 +95,7 @@
/** \brief Enable/disable UART transport layer. */ /** \brief Enable/disable UART transport layer. */
#define BOOT_COM_RS232_ENABLE (1) #define BOOT_COM_RS232_ENABLE (1)
/** \brief Configure the desired communication speed. */ /** \brief Configure the desired communication speed. */
#define BOOT_COM_RS232_BAUDRATE (57600) #define BOOT_COM_RS232_BAUDRATE (115200)
/** \brief Configure number of bytes in the target->host data packet. */ /** \brief Configure number of bytes in the target->host data packet. */
#define BOOT_COM_RS232_TX_MAX_DATA (64) #define BOOT_COM_RS232_TX_MAX_DATA (64)
/** \brief Configure number of bytes in the host->target data packet. */ /** \brief Configure number of bytes in the host->target data packet. */
@ -182,7 +182,7 @@
* a different checksum location, because this one is added at the end of the * a different checksum location, because this one is added at the end of the
* user program's vector table. * user program's vector table.
*/ */
#define BOOT_FLASH_VECTOR_TABLE_CS_OFFSET (0x10c) #define BOOT_FLASH_VECTOR_TABLE_CS_OFFSET (0x150)
/**************************************************************************************** /****************************************************************************************
@ -218,6 +218,8 @@
*/ */
#define BOOT_XCP_SEED_KEY_ENABLE (0) #define BOOT_XCP_SEED_KEY_ENABLE (0)
#define BOOT_FLASH_CUSTOM_LAYOUT_ENABLE (1)
#endif /* BLT_CONF_H */ #endif /* BLT_CONF_H */
/*********************************** end of blt_conf.h *********************************/ /*********************************** end of blt_conf.h *********************************/

View File

@ -80,6 +80,7 @@ blt_bool BackDoorEntryHook(void)
****************************************************************************************/ ****************************************************************************************/
blt_bool CpuUserProgramStartHook(void) blt_bool CpuUserProgramStartHook(void)
{ {
#if 0
/* additional and optional backdoor entry through the pushbutton on the board. to /* additional and optional backdoor entry through the pushbutton on the board. to
* force the bootloader to stay active after reset, keep it pressed during reset. * force the bootloader to stay active after reset, keep it pressed during reset.
*/ */
@ -90,6 +91,7 @@ blt_bool CpuUserProgramStartHook(void)
*/ */
return BLT_FALSE; return BLT_FALSE;
} }
#endif
/* clean up the LED driver */ /* clean up the LED driver */
LedBlinkExit(); LedBlinkExit();

View File

@ -72,12 +72,12 @@ void LedBlinkTask(void)
if (ledOn == BLT_FALSE) if (ledOn == BLT_FALSE)
{ {
ledOn = BLT_TRUE; ledOn = BLT_TRUE;
LL_GPIO_ResetOutputPin(GPIOC, LL_GPIO_PIN_12); LL_GPIO_ResetOutputPin(GPIOB, LL_GPIO_PIN_15);
} }
else else
{ {
ledOn = BLT_FALSE; ledOn = BLT_FALSE;
LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_12); LL_GPIO_SetOutputPin(GPIOB, LL_GPIO_PIN_15);
} }
/* schedule the next blink event */ /* schedule the next blink event */
nextBlinkEvent = TimerGet() + ledBlinkIntervalMs; nextBlinkEvent = TimerGet() + ledBlinkIntervalMs;
@ -94,7 +94,7 @@ void LedBlinkTask(void)
void LedBlinkExit(void) void LedBlinkExit(void)
{ {
/* turn the LED off */ /* turn the LED off */
LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_12); LL_GPIO_SetOutputPin(GPIOB, LL_GPIO_PIN_15);
} /*** end of LedBlinkExit ***/ } /*** end of LedBlinkExit ***/

View File

@ -97,14 +97,15 @@ static void Init(void)
static void SystemClock_Config(void) static void SystemClock_Config(void)
{ {
/* Set flash latency. */ /* Set flash latency. */
LL_FLASH_SetLatency(LL_FLASH_LATENCY_2); LL_FLASH_SetLatency(LL_FLASH_LATENCY_1);
/* Verify flash latency setting. */ /* Verify flash latency setting. */
if(LL_FLASH_GetLatency() != LL_FLASH_LATENCY_2) if(LL_FLASH_GetLatency() != LL_FLASH_LATENCY_1)
{ {
/* Error setting flash latency. */ /* Error setting flash latency. */
ASSERT_RT(BLT_FALSE); ASSERT_RT(BLT_FALSE);
} }
#if 0
/* Enable the HSE clock. */ /* Enable the HSE clock. */
LL_RCC_HSE_Enable(); LL_RCC_HSE_Enable();
@ -113,9 +114,10 @@ static void SystemClock_Config(void)
{ {
; ;
} }
#endif
/* Configure and enable the PLL. */ /* Configure and enable the PLL. */
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSE_DIV_1, LL_RCC_PLL_MUL_9); LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI_DIV_2, LL_RCC_PLL_MUL_9);
LL_RCC_PLL_Enable(); LL_RCC_PLL_Enable();
/* Wait till PLL is ready */ /* Wait till PLL is ready */
@ -124,7 +126,7 @@ static void SystemClock_Config(void)
; ;
} }
LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1); LL_RCC_SetAHBPrescaler(LL_RCC_SYSCLK_DIV_1);
LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_2); LL_RCC_SetAPB1Prescaler(LL_RCC_APB1_DIV_1);
LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1); LL_RCC_SetAPB2Prescaler(LL_RCC_APB2_DIV_1);
LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL); LL_RCC_SetSysClkSource(LL_RCC_SYS_CLKSOURCE_PLL);
@ -172,12 +174,12 @@ void HAL_MspInit(void)
#endif #endif
/* Configure GPIO pin for the LED. */ /* Configure GPIO pin for the LED. */
GPIO_InitStruct.Pin = LL_GPIO_PIN_12; GPIO_InitStruct.Pin = LL_GPIO_PIN_15;
GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT; GPIO_InitStruct.Mode = LL_GPIO_MODE_OUTPUT;
GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW; GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
LL_GPIO_Init(GPIOC, &GPIO_InitStruct); LL_GPIO_Init(GPIOB, &GPIO_InitStruct);
LL_GPIO_SetOutputPin(GPIOC, LL_GPIO_PIN_12); LL_GPIO_SetOutputPin(GPIOB, LL_GPIO_PIN_12);
/* Configure GPIO pin for (optional) backdoor entry input. */ /* Configure GPIO pin for (optional) backdoor entry input. */
GPIO_InitStruct.Pin = LL_GPIO_PIN_0; GPIO_InitStruct.Pin = LL_GPIO_PIN_0;

View File

@ -28,7 +28,7 @@ SHELL = sh
#|--------------------------------------------------------------------------------------| #|--------------------------------------------------------------------------------------|
#| Configure project name | #| Configure project name |
#|--------------------------------------------------------------------------------------| #|--------------------------------------------------------------------------------------|
PROJ_NAME=openblt_olimex_stm32p103 PROJ_NAME=openblt_sysmocom_rfdsatt
#|--------------------------------------------------------------------------------------| #|--------------------------------------------------------------------------------------|
@ -140,6 +140,7 @@ all: $(BIN_PATH)/$(PROJ_NAME).srec
$(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf $(BIN_PATH)/$(PROJ_NAME).srec : $(BIN_PATH)/$(PROJ_NAME).elf
@$(OC) $< $(OFLAGS) $@ @$(OC) $< $(OFLAGS) $@
@$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map @$(OD) $(ODFLAGS) $< > $(BIN_PATH)/$(PROJ_NAME).map
@$(OC) -O binary $^ $(BIN_PATH)/$(PROJ_NAME).bin
@echo +++ Summary of memory consumption: @echo +++ Summary of memory consumption:
@$(SZ) $(SZFLAGS) $< @$(SZ) $(SZFLAGS) $<
@echo +++ Build complete [$(notdir $@)] @echo +++ Build complete [$(notdir $@)]