embedded

How to switch linux kernel console after boot process?

夙愿已清 提交于 2019-12-03 11:47:08
问题 On my embedded system I usually use /dev/ttyS0 as a main console. This is achieved by passing kernel parameter console=/dev/ttyS0 and when init takes its part, getty is fired on the same device as specified in inittab by eg. ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100 . Is there any possibility to change these settings without restart and switch the console to another terminal like ttyS1 , ttyUSBx or even some pseudo tty? 回答1: It seems that perhaps you don't actually want the console log

Continuous Integration/ Unit testing in embedded C++ systems

一个人想着一个人 提交于 2019-12-03 11:42:58
问题 What tools are generally used for unit testing and especially continuous integration for embedded systems? I am especially thinking that you usually have to cross-compile and deploy, and also that you can't easily visualize the target platform. Also it can be difficult to run test-code and frameworks. What could I use too alleviate these difficulties? (I think it should be some kind of dual targeting, where the build server runs its tests on a easier target) 回答1: For unit testing, take a look

What is the difference between the firmware and the operating system?

旧时模样 提交于 2019-12-03 11:40:29
问题 In embedded devices such as printer, switches, I am confused what the difference between the firmware and the operating system is. Are embedded devices operating systems similar to PCs (Linux and Windows)? For example, I have a printer which has an embedded web server that allows me to manage the printer remotely. When I open the manufacturer website, I find that the OS is: OS 9.86. What kind of OS is this? See: Phaser 8560 Support & Drivers 回答1: Firmware refers to a small piece of code that

What would be a pratical example of sysroot and prefix options for Qt

半城伤御伤魂 提交于 2019-12-03 11:21:15
I'm looking at all the options that can be run for the configure script provided with Qt. (specifically qt-everywhere-opensource-src-5.2.0). After considerable searching, I've determined this stuff is poorly documented at best so I was hoping I could get some help. When I look at the descriptions for prefix and sysroot configuration options: ~/qt-everywhere-opensource-src-5.2.0$ ./configure -help | grep "sysroot" -extprefix <dir> ... When -sysroot is used, install everything to <dir> , -sysroot <dir> ...... Sets <dir> as the target compiler's and qmake's sysroot and also sets pkg-config paths.

Who uses POSIX realtime signals and why?

时光怂恿深爱的人放手 提交于 2019-12-03 10:47:55
问题 I am not being flip I really don't get it. I just read a whole bunch of material on them and I can't figure out the use case. I am not talking talking so much about the API for which the advantages over things like signal() are clear enough. Rather it seems RT signals are meant to be user space generated but to what end? The only use seems to be a primitive IPC but everything points to them being a lousy form of IPC (e.g. awkward, limited information, not particularly efficient, etc). So

Undefined reference to 'operator delete(void*)'

[亡魂溺海] 提交于 2019-12-03 10:46:00
I'm new to C++ programming, but have been working in C and Java for a long time. I'm trying to do an interface-like hierarchy in some serial protocol I'm working on, and keep getting the error: Undefined reference to 'operator delete(void*)' The (simplified) code follows below: PacketWriter.h: class PacketWriter { public: virtual ~PacketWriter() {} virtual uint8_t nextByte() = 0; } StringWriter.h: class StringWriter : public PacketWriter { public: StringWriter(const char* message); virtual uint8_t nextByte(); } The constructor and nextByte functions are implemented in StringWriter.cpp, but

What are traps?

谁都会走 提交于 2019-12-03 10:30:30
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? 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 a switch between user and system address spaces). This is useful for handling conditions that occur rarely

Is there a way of compiling C11 to C89?

时光怂恿深爱的人放手 提交于 2019-12-03 09:59:52
One of my (embedded) targets only has a C89 compiler. I am working on a (hobby) project which targets multiple devices. Is there a way of compiling (transpiling?) a C11 code base into C89? (Otherwise I will have to code like it's 1989, literally.) No I don't think that it is possible for all of C11. C11 has features that simply not exist in C89 or C99: _Generic , _Atomic , _Thread , _Alignof , well defined sequenced before ordering, unnamed struct and union members ... These don't have counter parts in the older versions and would be really difficult to emulate . For any of these features you

How to find a memory leak in C++

佐手、 提交于 2019-12-03 09:55:25
问题 What would be a good way to detect a C++ memory leak in an embedded environment? I tried overloading the new operator to log every data allocation, but I must have done something wrong, that approach isn't working. Has anyone else run into a similar situation? This is the code for the new and delete operator overloading. EDIT: Full disclosure: I am looking for a memory leak in my program and I am using this code that someone else wrote to overload the new and delete operator. Part of my

Handling stack overflows in embedded systems

橙三吉。 提交于 2019-12-03 09:47:02
问题 In embedded software, how do you handle a stack overflow in a generic way? I come across some processor which does protect in hardware way like recent AMD processors. There are some techniques on Wikipedia, but are those real practical approaches? Can anybody give a clear suggested approach which works in all case on today's 32-bit embedded processors? 回答1: Ideally you write your code with static stack usage (no recursive calls). Then you can evaluate maximum stack usage by: static analysis