embedded-linux

print stack trace in arm-linux

南楼画角 提交于 2019-12-01 20:48:27
I followed this post to print stack trace How to generate a stacktrace when my gcc C++ app crashes . It works well in x86 linux. Can anyone teach me how to make it work on arm-linux? I am using arm-linux-gcc 4.4.3. [root@FriendlyARM /]# ./test1 Error: signal 11: [0x0] in x86 mickey@mickeyvm:~/Desktop/workspace/test/testCatchSeg/src$ ./test1 Error: signal 11: ./test1(_Z7handleri+0x19)[0x804876d] [0xedd400] ./test1(_Z3bazv+0x10)[0x80487c2] ./test1(_Z3barv+0xb)[0x80487e1] ./test1(_Z3foov+0xb)[0x80487ee] ./test1(main+0x22)[0x8048812] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x84de37]

Cancelling pthread_cond_wait() hangs with PRIO_INHERIT mutex

自古美人都是妖i 提交于 2019-12-01 20:24:23
问题 Update, 4/10 2012: Fixed by libc patch I have a problem canceling threads in pthread_cond_wait , that use mutexes with the PTHREAD_PRIO_INHERIT attribute set. This only happens on certain platforms though. The following minimal example demonstrates this: (compile with g++ <filename>.cpp -lpthread ) #include <pthread.h> #include <iostream> pthread_mutex_t mutex; pthread_cond_t cond; void clean(void *arg) { std::cout << "clean: Unlocking mutex..." << std::endl; pthread_mutex_unlock((pthread

Cancelling pthread_cond_wait() hangs with PRIO_INHERIT mutex

瘦欲@ 提交于 2019-12-01 20:17:28
Update, 4/10 2012: Fixed by libc patch I have a problem canceling threads in pthread_cond_wait , that use mutexes with the PTHREAD_PRIO_INHERIT attribute set. This only happens on certain platforms though. The following minimal example demonstrates this: (compile with g++ <filename>.cpp -lpthread ) #include <pthread.h> #include <iostream> pthread_mutex_t mutex; pthread_cond_t cond; void clean(void *arg) { std::cout << "clean: Unlocking mutex..." << std::endl; pthread_mutex_unlock((pthread_mutex_t*)arg); std::cout << "clean: Mutex unlocked..." << std::endl; } void *threadFunc(void *arg) { int

How to limit the size of core dump file when generating it using GDB

老子叫甜甜 提交于 2019-12-01 16:42:59
I am running an embedded application on ARM9 board, where total flash size is 180MB only. I am able to run gdb , but when I do (gdb) generate-core-dump I get an error warning: Memory read failed for corefile section, 1048576 bytes at 0x4156c000. warning: Memory read failed for corefile section, 1048576 bytes at 0x50c00000. Saved corefile core.5546 The program is running. Quit anyway (and detach it)? (y or n) [answered Y; input not from terminal] Tamper Detected **********OUTSIDE ifelse 0********* length validation is failed I also set ulimit -c 50000 but still the core dump exceeds this limit.

fsync, sync: does it really do what its supposed to? [closed]

谁说我不能喝 提交于 2019-12-01 16:00:58
I would like to have more clarification on the functionality of sync(8) and fsync functions in Linux (2.6.31). Does it make sure the files are written to the respective storage? Oliver http://linux.die.net/man/8/sync It does not make sure that files are written to respective storage. It only makes sure that cached/buffered data is flushed to the disk device. It doesn't matter if this is an SD Card or whatever. 来源: https://stackoverflow.com/questions/12262454/fsync-sync-does-it-really-do-what-its-supposed-to

Why is kernel boot too late?

拈花ヽ惹草 提交于 2019-12-01 12:06:27
问题 I have zynq-microzed board and my log messages are following... [Mon Jun 09 19:28:38.231 2014] SF: Detected S25FL129P_64K/S25FL128S_64K with page size 64 KiB, total 16 MiB [Mon Jun 09 19:28:38.446 2014] SF: 1245184 bytes @ 0x520000 Read: OK [Mon Jun 09 19:28:38.446 2014] ## Loading kernel from FIT Image at 01000000 ... [Mon Jun 09 19:28:38.446 2014] Using 'conf@1' configuration [Mon Jun 09 19:28:38.446 2014] Trying 'kernel@1' kernel subimage [Mon Jun 09 19:28:38.446 2014] Description:

Buildroot - Applying A Patch Failed

夙愿已清 提交于 2019-12-01 10:44:37
问题 I'm trying to build a custom kernel image for my PhidgetSBC but I'm getting a failure during the build: bluez 4.96 Extracting bluez 4.96 Patching package/bluez for file in config.guess config.sub; do for i in $(find /home/kerubu/buildroot_phidgetsbc/new/buildroot-phidgetsbc_1.0.4.20111028/output/build/bluez-4.96 -name $file); do cp package/gnuconfig/$file $i; done; done Patching libtool Applying buildroot-libtool.patch using plaintext: patching file ltmain.sh Hunk #1 FAILED at 273. Hunk #2

Vectors page mapping in linux for ARM

谁都会走 提交于 2019-12-01 09:04:18
I am trying to understand how vectors page is mapped to 0xffff0000. I am referring 3.14 kernel. As per the comment in early_trap_init() traps.c the vectors are copied from entry-armv.S to vector page. It seems early_trap_init() is called from devicemaps_init() mmu.c . Before calling early_trap_init() , it is creating vectors page using early_alloc() and I couldn't see any mapping here. Can you please help to understand how vectors page mapping is done? artless noise The answer is in your devicemaps_init() link (about line 1250 in 3.14). /* * Create a mapping for the machine vectors at the high

How to change the watchdog timer in linux embedded

本秂侑毒 提交于 2019-12-01 07:59:02
问题 I have to use the linux watchdog driver (/dev/watchdog). It works great, I write an character like this: echo 1 > /dev/watchdog And the watchdog start and after an about 1 minute, the system reboot. The question is, how can I change the timeout? I have to change the time interval in the driver? 回答1: Please read the Linux documentation. The standard method of changing the timeout from user space is to use an ioctl() . int timeout = 45; /* a time in seconds */ int fd; fd = open("/dev/watchdog")

Vectors page mapping in linux for ARM

戏子无情 提交于 2019-12-01 06:14:10
问题 I am trying to understand how vectors page is mapped to 0xffff0000. I am referring 3.14 kernel. As per the comment in early_trap_init() traps.c the vectors are copied from entry-armv.S to vector page. It seems early_trap_init() is called from devicemaps_init() mmu.c. Before calling early_trap_init() , it is creating vectors page using early_alloc() and I couldn't see any mapping here. Can you please help to understand how vectors page mapping is done? 回答1: The answer is in your devicemaps