Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Translation_Bot
Community Manager
Community Manager
Community Manager
 static uint8_t FD_EraseData [] __attribute__ ((aligned( 4 ) , used)) = { 0x30 , 0xB5 , 0x0F , 0x49 , 0x00 , 0x20 , 0x04 0x49 , 0x00 , 0x20 , 0x04x , 0Ex 0x1B , 0x5C , 0x13 , 0x54 ,
    0x01 , 0x30 , 0xF5 , 0x22 , 0xFF , 0x32 , 0x90 , 0x42 , 0xF6 , 0xD3 , 0x30 , 0xBD , 0x30 };

typedef uint8_t (*FlsDrvFun_EraseType)( uint32_t );
FlsDrvFun_EraseType FlsDrvFun_Erase = (FlsDrvFun_EraseType )FD_EraseData + 1 ;
 
報錯:
"..\..\src\main_cm0plus.c", line 82: error #171: invalid type conversion FlsDrvFun_EraseType FlsDrvFun_Erase = (FlsDrvFun_EraseType )FD_EraseData + 1;

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT2B73-%E4%BD%BF%E7%94%A8greenhills%E7%BC%96%E8%AF%91%E5%99%A8%E6%97%B6-%E6%97%A0%E6%B3%95%E5%B0%86%E6%95%B0%E7%BB%84%E5%90%8D%E5%BC%BA%E5%88%B6%E8%BD%AC%E6%8D%A2%E4%B8%BA%E5%87%BD%E6%95%B0%E6%8C%87%E9%92%88-%E5%BA%94%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3/td-p/687609

2 回應
Translation_Bot
Community Manager
Community Manager
Community Manager

不可用 

后面我参考 RSA 的使用例程

hw_1-1707125678985.png

编写函数指针 ,调用时仍会进入硬件错位中断。不管设置的绝对地址是多少

hw_0-1707125632024.png

hw_2-1707125834008.png

注:未初始化 使能 mpu 

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT2B73-%E4%BD%BF%E7%94%A8greenhills%E7%BC%96%E8%AF%91%E5%99%A8%E6%97%B6-%E6%97%A0%E6%B3%95%E5%B0%86%E6%95%B0%E7%BB%84%E5%90%8D%E5%BC%BA%E5%88%B6%E8%BD%AC%E6%8D%A2%E4%B8%BA%E5%87%BD%E6%95%B0%E6%8C%87%E9%92%88-%E5%BA%94%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3/m-p/689581

0
Translation_Bot
Community Manager
Community Manager
Community Manager

你好,

直接typedef uint8_t (*FlsDrvFun_EraseType) = FD_EraseData,把它變成指向陣列首元素的指標不行嗎?

 

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/TRAVEO-T2G/CYT2B73-%E4%BD%BF%E7%94%A8greenhills%E7%BC%96%E8%AF%91%E5%99%A8%E6%97%B6-%E6%97%A0%E6%B3%95%E5%B0%86%E6%95%B0%E7%BB%84%E5%90%8D%E5%BC%BA%E5%88%B6%E8%BD%AC%E6%8D%A2%E4%B8%BA%E5%87%BD%E6%95%B0%E6%8C%87%E9%92%88-%E5%BA%94%E5%A6%82%E4%BD%95%E8%A7%A3%E5%86%B3/m-p/687643

0