91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 148KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-28
  • 語言: 其他
  • 標簽: DSP??

資源簡介

28335二階bootloader,可以實現遠程應用升級, 非常好用

資源截圖

代碼片段和文件信息

/*
?*?BootLoader.c
?*
?*??Created?on:?2017年4月19日
?*??????Author:?admin
?*/
#include?“BootLoader.h“
bootloader_data?Boot_ID_info;
u8 ???data_temp[DATA_LEN*2];
Uint16?write_temp[DATA_LEN];
Uint16?read_temp[READ_MAX];
u8?can_cmd??????????=?(u8?)0x00;//ID的bit0~bit3位為命令碼
u32?read_addr???????=?(u32)0x00;//讀取數據起始地址
u32?read_len????????=?(u32)0x00;//讀取數據長度
u16?crc_data????????=?(u16)0x00;
u16?can_addr????????=?(u16)0x00;;//ID的bit4~bit15位為節點地址
u32?start_addr??????=?(u32)0x00;//每一包數據的起始地址
u32?data_size???????=?(u32)0x00;//數據包的大小
u32?data_index??????=?(u32)0x00;//數據指針
u32?FlashSize???????=?(u32)0x00;
uint32_t?exe_type???=?(u32)0x00;
u8?file_type?=?File_None;
Uint16?app_check[3]?=?{0xFFFF0xFFFF0xF5F4};

Boot_CMD_LIST?cmd_list?=
{
.Read????????=?0x0A?//讀取flash數據
.Erase???????=?0x00?//擦除APP區域數據
.Write???????=?0x02?//以多字節形式寫數據
.Check???????=?0x03?//檢測節點是否在線,同時返回固件信息
.Excute??????=?0x05?//執行固件
.CmdFaild????=?0x09?//命令執行失敗
.WriteInfo???=?0x01?//設置多字節寫數據相關參數(寫起始地址數據量)
.CmdSuccess??=?0x08?//命令執行成功
.SetBaudRate?=?0x04?//設置節點波特率
};
Device_INFO?DEVICE_INFO?=
{

?.FW_Version.bits.Version???????=?31
?.FW_Version.bits.date??????????=?31
?.FW_Version.bits.month?????????=?12
?.FW_Version.bits.year??????????=?2017
?.Device_addr.bits.reserve??????=?0x00
?.FW_TYPE.bits.FW_type??????????=?CAN_BL_BOOT
?.FW_TYPE.bits.Chip_Value???????=?TMS320F28335
?.Device_addr.bits.Device_addr??=?DEVICE_ADDR
};
//關于全局中斷相關操作主要是為了和STM32保持一致便于一致代碼
void?__disable_irq(void)
{
//關閉全局中斷
DINT;
DRTM;
}
void?__enable_irq(void)
{
//打開全局中斷
EINT;
ERTM;
}
void?__set_PRIMASK(u8?state)
{
if(state?==?1)
{
__disable_irq();//關閉全局中斷
}
else?if(state?==?0)
{
__enable_irq();//打開全局中斷
}
else
{
return;
}
}
unsigned?short?int?CRCcalc16?(unsigned?char?*dataunsigned?short?int?len)
{
int?i;
unsigned?short?int?crc_res?=??0xFFFF;
while(len--)
{
crc_res^=*data++;
for(i?=?0;i? {
if(crc_res&0x01)
{
crc_res?=?(crc_res>>1)^0xa001;
}
else
{
crc_res?=?(crc_res>>1);
}
}
}
return?crc_res;
}
void?CAN_BOOT_JumpToApplication(uint32_t?Addr)
{
//??asm(“?LB??0x310000“);?//最開始采用的是匯編跳轉方式只能跳轉為固定的地址
???//?(*((void(*)(void))(Addr)))();??//后續參考STM32的跳轉方式
//(*(pFunction)(Addr))();
pFunction?jump;
jump?=?(pFunction)(Addr);
jump();

}
#pragma?CODE_SECTION(CAN_BOOT_ExecutiveCommand“ramfuncs“);
void?CAN_BOOT_ExecutiveCommand(CanRxMsg?*pRxMessage)
{
u8?i;
CanTxMsg?TxMessage;//發送對應消息
Uint16?ret?=?0x01;
FLASH_ST?Flash_Status;
for(i?=?0;i?<8;i++)
{
TxMessage.CAN_Tx_msg_data.msg_byte.data[i]?=?0x00;
}
TxMessage.CAN_num??????????=?CANA;
TxMessage.DLC??????????????=?1;
TxMessage.ExtId.bit.resved?=?0x00;
TxMessage.IDE??????????????=?CAN_ID_EXT;
TxMessage.MBox_num?????????=?0x02;
TxMessage.Tx_timeout_cnt???=?0x00;
TxMessage.SAE_J1939_Flag???=?0;
//獲取地址信息
Boot_ID_info.ExtId.all?????=?pRxMessage->ExtId.bit.ExtId;
can_cmd?=?Boot_ID_info.ExtId.bit.cmd;
can_addr?=?Boot_ID_info.ExtId.bit.addr;
if((can_addr!=DEVICE_ADDR)&&(can_addr!=0))
{

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\
?????文件?????????666??2018-03-25?03:01??28335CAN_Update_Flash-master\.ccsproject
?????文件???????27209??2018-03-25?03:01??28335CAN_Update_Flash-master\.cproject
?????文件??????????39??2018-03-25?03:01??28335CAN_Update_Flash-master\.gitignore
?????文件?????????813??2018-03-25?03:01??28335CAN_Update_Flash-master\.project
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\BootLoader\
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\BootLoader\inc\
?????文件????????4293??2018-03-25?03:01??28335CAN_Update_Flash-master\BootLoader\inc\BootLoader.h
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\BootLoader\src\
?????文件???????17634??2018-03-25?03:01??28335CAN_Update_Flash-master\BootLoader\src\BootLoader.c
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\Flash28335_API_V210\
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\Flash28335_API_V210\Lib\
?????文件???????76026??2018-03-25?03:01??28335CAN_Update_Flash-master\Flash28335_API_V210\Lib\Flash28335_API_V210.lib
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\Flash28335_API_V210\inc\
?????文件????????3034??2018-03-25?03:01??28335CAN_Update_Flash-master\Flash28335_API_V210\inc\Flash2833x_API_Config.h
?????文件????????9056??2018-03-25?03:01??28335CAN_Update_Flash-master\Flash28335_API_V210\inc\Flash2833x_API_Library.h
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\inc\
?????文件????????3665??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\inc\CANA.h
?????文件?????????452??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\inc\Flash.h
?????文件?????????499??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\inc\LED.h
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\src\
?????文件???????17041??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\src\CANA.c
?????文件?????????965??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\src\Flash.c
?????文件????????1490??2018-03-25?03:01??28335CAN_Update_Flash-master\bsp\src\LED.c
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\user\
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\user\inc\
?????文件?????????360??2018-03-25?03:01??28335CAN_Update_Flash-master\user\inc\main.h
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\user\src\
?????文件????????1952??2018-03-25?03:01??28335CAN_Update_Flash-master\user\src\main.c
?????目錄???????????0??2018-03-25?03:01??28335CAN_Update_Flash-master\user_lib\
............此處省略58個文件信息

評論

共有 條評論