BSP
aa图图aa
这个作者很懒,什么都没留下…
展开
-
gnu shell脚本转换链接脚本里的#include命令
在项目中需要在某个.h文件中对内存地址进行统一管理,而LD文件是无法直接#include包含.h文件的,因此通过以下脚本重新转换ld文件以间接实现该功能。compiler=/编译工具链路径/arm-none-eabi-gcc。out=/输出新ld文件路径/sample_gen.ld。in=/原ld文件路径/sample.ld。include=/.h文件路径。...原创 2022-08-17 14:18:29 · 259 阅读 · 1 评论 -
GCC指定某个c文件里的函数或者变量到某个section
.o(.func_text_section)//使用attribute属性指向该段的函数。2定义func段,将文件file_a.c、file_b.c、file_c.c中的函数放到这个段。3定义data段,将文件file_a.c、file_b.c、file_c.c中的数据放到这个段。注意需要初始化阶段对代码和数据进行重定向,从DDR的存储地址拷贝到实际的运行地址去。1定义某个section的属性。...原创 2022-07-29 14:57:59 · 1833 阅读 · 0 评论 -
linux内存泄漏检测工具
AddressSanitizer添加编译选项:用-fsanitize=address选项编译和链接你的程序;用-fno-omit-frame-pointer编译,以在错误消息中添加更好的堆栈跟踪。将libasan.so下载到开发板export LD_PRELOAD=./libasan.so原创 2022-02-12 19:46:37 · 638 阅读 · 0 评论 -
基于GNU、arm v7、threadx的backtrace
根据栈帧FP进行backtrace,threadx会在任务调度前将sp指向申请的任务栈空间,任务栈空间可在链接脚本中指定。随便写个例子如下:void func0(){ int i = 6; i++;}void func1(){ *(uint32_t *)0x80000000 = 1; //访问一块不在mpu范围内的内存会发生Abort func0();}void func2(){ f...原创 2021-12-09 10:04:48 · 250 阅读 · 0 评论 -
R8 TCM使用说明
1:链接文件定义section:TCM(rwx): ORIGIN= xxx, LENGTH = yyy.tcm_section :{ .= ALIGN(4); *.0 (.tcm_section)} >TCM AT > DDR2:代码中配置、使能TCM并进行代码重定向3:函数使用__attribute__((section(".tcm_section")))...原创 2021-11-27 15:15:23 · 151 阅读 · 0 评论 -
arm cortex-R8 MPU和cache全破解
一:内存属性:Bufferable: A write to the memory can be carried out by a write buffer while the processor continues to execute the next instruction.Cacheable: Data obtained from memory read can be copied to a memory cache so that the next time it is accessed t原创 2021-09-01 16:15:24 · 1429 阅读 · 0 评论 -
如何区分一个.so是否为PIC
readelf -d foo.so | grep TEXTREL如果上面的命令有任何输出,那么foo.so就不是PIC的,否则就是PIC的。PIC的.so是不会包含任何代码段重定位表的,TEXTREL表示代码段重定位地址。原创 2021-07-16 16:41:59 · 386 阅读 · 0 评论 -
newlib中malloc如何获取heap地址
newlib代码:caddr_t_sbrk (int incr){ extern char end asm ("end"); /* Defined by the linker. */ static char * heap_end; char * prev_heap_end; if (heap_end == NULL) heap_end = & end; prev_heap_end = heap_end; if (heap...原创 2021-07-15 10:19:14 · 401 阅读 · 0 评论 -
记录DS-5上工程AC5移植到AC6的奇葩问题
1:LDMIA sp!, {lr, r1}warning: register list not in ascending order解决方法:LDMIA sp!, {r1, lr}2: .global _tx_thread_context_save_tx_thread_context_save:Error: L6286E: Relocation #REL:4 in startup.o(StartUp) with respect to _tx_thread_context_...原创 2021-05-12 11:39:56 · 415 阅读 · 0 评论 -
GIt push error
remote: ERROR: commit 1cc115a: email address @grandsun.com is not registered in your account, and you lack 'forge committer' permission.git config --global user.email "[email protected]"git config --global user.name "cc"git commit --amend --reset-author.原创 2020-11-02 16:12:12 · 274 阅读 · 0 评论 -
基于LPC55xxx CM33核的TrustZone原理与应用
一:概述为了更好地提高MCU的安全性能,Arm在ARMv8-M架构中引入了TrustZone技术。ARMv8-M中的TrustZone技术是一种可选择的安全扩展,旨在为各种嵌入式系统应用提供基本的安全保障。本文基于CM33核的LPC55sxx系列开发板,MCUXpresso IDE v11.1.1_3241集成开发工具。二:实现原理2.1:区域划分TrustZone将内存和外设分为安全区域(S)和非安全区域(NS),CPU访问S时可认为CPU处于安全状态(CPU-S),访问NS时...原创 2020-08-18 19:51:29 · 1719 阅读 · 0 评论