forked from gary/BCU
2
0
Fork 0
BCU/app/stm32fxxx_boot/user/app_config.h

63 lines
2.3 KiB
C

#ifndef BMS_CONFIG_H_
#define BMS_CONFIG_H_
#ifdef __cplusplus
extern "C" {
#endif
/***************************MCU配置*********************/
#define APP_CFG_FLASH_PAGE_SIZE (1024*2)
/***************************中断优先级*********************/
#define APP_CFG_INT_PRIO_PWR_OFF 0u
#define APP_CFG_INT_PRIO_CAN1_RX 1u
#define APP_CFG_INT_PRIO_CAN1_TX 2u
#define APP_CFG_INT_PRIO_CAN2_RX 3u
#define APP_CFG_INT_PRIO_CAN2_TX 4u
#define APP_CFG_INT_PRIO_SYSTICK 5u
#define APP_CFG_INT_PRIO_UART2_RX 6u
/*************************Flash分区***************************************
+-------+------+-------+-------+-------+--------+--------+--------+
| BOOT | EE | EE_B | EEE | EEE_B | APP | BACKUP | E-TAG |
| 16K | 16K | 16K | 16K | 64K | 128K*3 | 128K*3 | 128K |
+-------+------+-------+-------+-------+--------+--------+--------+
*************************************************************************/
#define APP_CFG_BOOT_START_ADDR (0x08000000u)
#define APP_CFG_BOOT_FW_SIZE (0x4000u) //16K
#define APP_CFG_EEPROM_START_ADDR (APP_CFG_BOOT_START_ADDR + APP_CFG_BOOT_FW_SIZE)
#define APP_CFG_EEPROM_SIZE (0x4000 * 3 + 0x4000 * 4) //16K
#define APP_CFG_APP_START_ADDR (APP_CFG_EEPROM_START_ADDR + APP_CFG_EEPROM_SIZE)
#define APP_CFG_FIRMWARE_SIZE (0x4000 * 8 * 3) //256K
#define APP_CFG_BACKUP_START_ADDR (APP_CFG_APP_START_ADDR + APP_CFG_FIRMWARE_SIZE)
#define APP_CFG_E_TAG_ADDR (APP_CFG_BACKUP_START_ADDR + APP_CFG_FIRMWARE_SIZE)
#define APP_CFG_TAG_OFFSET (0x188u) //放在向量表结束 __Vectors_End 地址
#define APP_CFG_PRODUCT_NUMBER_OFFSET (APP_CFG_TAG_OFFSET + 2)
/***************************继电器个数*********************/
#define APP_CFG_RELAY_NUM 8u
/***************************设备特性*********************/
#define APP_DEVICE_TYPE NUMBER_TYPE_BCU //NUMBER_TYPE_BSU
#define PRODUCT_NUMBER NUMBER_ASSEMBLE(APP_DEVICE_TYPE, NUMBER_APPL_E, NUMBER_VER_C, NUMBER_BCU_1B)
#define HMI_SND_CAN_ID (0x1C000000 | APP_DEVICE_TYPE)
#define HMI_RCV_CAN_ID1 (0x1C0000E0 | APP_DEVICE_TYPE)
#define HMI_RCV_CAN_ID2 (0x1C0000D0 | APP_DEVICE_TYPE)
#define HMI_RCV_CAN_RESERVE1 (0x1C0000C0 | APP_DEVICE_TYPE)
#ifdef __cplusplus
}
#endif
#endif