embedded

How to prevent inclusion of C library destructors and atexit()?

北战南征 提交于 2019-12-04 20:41:47
问题 Using arm-none-eabi-gcc for Cortex-M4 (baremetal application), the code for malloc is also emitted even though I never use malloc in my code. Seeing the assembly output with arm-none-eabi-objdump -xS obj.elf , it seems that malloc is called by __register_exitproc called by atexit called by register_fini 004036a8 <register_fini>: 4036a8: 4b02 ldr r3, [pc, #8] ; (4036b4 <register_fini+0xc>) 4036aa: b113 cbz r3, 4036b2 <register_fini+0xa> 4036ac: 4802 ldr r0, [pc, #8] ; (4036b8 <register_fini

What do I need to debug pthreads?

本小妞迷上赌 提交于 2019-12-04 20:14:03
问题 I want to debug pthreads on my custom linux distribution but I am missing something. My host is Ubuntu 12.04, my target is an i486 custom embedded Linux built with a crosstool-NG cross compiler toolset, the rest of the OS is made with Buildroot. I will list the facts: I can run multi-threaded applications on my target Google Breakpad fails to create a crash report when I run a multi-threaded application on the target. The exact same application with the exact same build of Breakpad libraries

Coherently understand the software-hardware interaction with regard to DMA and buses

做~自己de王妃 提交于 2019-12-04 19:54:15
I've gathered some level of knowledge on several components (including software and hardware) which are involved in general DMA transactions in ARM based boards, but I don't understand how is it all perfectly integrated, I didn't find a full coherent description about this. I'll write down the high level of the knowledge I already have and I hope that someone could fix me where I'm wrong and complete the missing parts so the whole picture would be clear. My description starts with the userspace software and drills down to the hardware components. The misunderstood parts are in italic-bold

How to statically identify dynamic heap allocation?

跟風遠走 提交于 2019-12-04 19:27:55
I'm about to remove "as many as possible" dynamic heap allocation in my application and I wonder how I can make sure I didn't miss anything. Currently I'm looking for a way to easily or even automatically tell, if any (or which) parts of the code might invoke the standard implementations of new / delete or malloc / free without having to dynamically trace allocations (i.e. via static code analysis or feedback from compiler/linker). It's easy to spot (or search for) code which directly calls new or malloc of course: int main() { auto s = new std::string(); delete s; } Just in case the

Guarantee TCP Packet Size

丶灬走出姿态 提交于 2019-12-04 18:05:43
We use an embedded device to send packets from a serial port over a serial-to-Ethernet converter to a server. One manufacturer we use, Moxa, will always send the packets in the same manner which they are constructed. Meaning, if we construct a packet size of 255, it will always send the packet in a 255 length. The other manufacturer, Tibbo, if we send the packet size 255, it will break the packet up if it is greater than 128. This is the answer I received from the Tibbo engineers at the time: "From what I understand and what the engineers said, even if the other devices provide you with the

Embedded Linux – mechanism for deploying firmware updates? [closed]

僤鯓⒐⒋嵵緔 提交于 2019-12-04 17:54:41
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am considering developing on the Yocto project for an embedded Linux project (an industrial application) and I have a few questions for those with experience with embedded Linux in general -- Yocto experience a bonus. Just need to get an idea of what is being commonly done in firmware updates. I have a few

What are traps?

怎甘沉沦 提交于 2019-12-04 16:26:22
问题 There are many different types of traps listed in processor datasheets, e.g. BusFault, MemManage Fault, Usage Fault and Address Error. What is their purpose? How can they be utilized in fault handling? 回答1: Traps are essentially subroutine calls that are forced by the processor when it detects something unusual in your stream of instructions. (Some processors make them into interrupts, but that's mostly just pushing more context onto the stack; this gets more interesting if the trap includes

synchronization between two tasks

旧街凉风 提交于 2019-12-04 15:44:01
This is actually a design question for firmware in an embedded system I have two ISRs (of same priority) executed independently . These ISRs are triggered when the h/w generates data. I want a mechanism which must be put in place to synchronise between task1 and task2. task 2 must know about the certain values calculated in task1 which must then be taken into account while computing certain values in task2. I don't have OS primitives to use ie the system does not have any Operating system. Task1 is executed within the context of ISR1 and task2 within the context of ISR2. The processor which we

Do interrupts interrupt other interrupts on Arduino?

别等时光非礼了梦想. 提交于 2019-12-04 15:35:28
问题 I have an Arduino Uno (awesome little device!). It has two interrupts; let's call them 0 and 1 . I attach a handler to interrupt 0 and a different one to interrupt 1, using attachInterrupt() : http://www.arduino.cc/en/Reference/AttachInterrupt. Interrupt 0 is triggered and it calls its handler, which does some number crunching. If interrupt 0 's handler is still executing when interrupt 1 is triggered, what will happen? Will interrupt 1 interrupt interrupt 0 , or will interrupt 1 wait until

Is there a need to close file descriptors before exit?

走远了吗. 提交于 2019-12-04 15:27:52
问题 Of course, the immediate answer for most situations is "yes" , and I am a firm believer that a process should correctly cleanup any resources it has allocated, but what I have in my situation is a long-running system daemon that opens a fixed number of file descriptors at the startup, and closes them all before exiting. This is an embedded platform, and I'm trying to make the code as compact as possible, while not introducing any bad style. But since file descriptors are closed before exit