embedded

How to convert monochrome image to bitwise format for thermal printer

余生颓废 提交于 2019-12-21 19:52:50
问题 I'm using a Custom s'print DPT100-S thermal printer to made a receipt printing application. It is able to print graphics using 384 pixels in one line. This data has to be passed on to the printer using 48 bytes (48x8=384). So, each 'bit' represents one dot to be printed (bit will be '0' for white and '1' for black). So, I need to create a program which will read a monochrome BMP generated in Windows Paint(or any other program) and convert it into this bit format using a C program in Linux.

How do I capture and view ITM trace information on a Cortex-M4 MCU?

此生再无相见时 提交于 2019-12-21 15:37:49
问题 I would like to capture, decode, and view ITM trace information for a Cortex-M4 MCU (in my case, an Atmel SAM4S). In particular, I want to capture exceptions and user trace data relative to other signals on my board (i.e. show all signals and trace information on same timeline). 回答1: This can be done using the following steps: Place debugger in SWD mode. If using J-Link Segger on Linux, this can be done with JLinkGDBServer -if swd Add code to the MCU to enable trace. Set the bit rate to a

#define vs. enums for addressing peripherals

北慕城南 提交于 2019-12-21 12:35:56
问题 I have to program peripheral registers in an ARM9-based microcontroller. For instance, for the USART, I store the relevant memory addresses in an enum : enum USART { US_BASE = (int) 0xFFFC4000, US_BRGR = US_BASE + 0x16, //... }; Then, I use pointers in a function to initialize the registers: void init_usart (void) { vuint* pBRGR = (vuint*) US_BRGR; *pBRGR = 0x030C; //... } But my teacher says I'd better use #define s, such as: #define US_BASE (0xFFFC4000) #define US_BRGR (US_BASE + 0x16)

Cross-Compiling for an embedded ARM-based Linux system

醉酒当歌 提交于 2019-12-21 11:03:13
问题 I try to compile some C code for an embedded (custom) ARM-based Linux system. I set up an Ubuntu VM with a cross-compiler named arm-linux-gnueabi-gcc-4.4 because it looked like what I needed. Now when I compile my code with this gcc, it produces a binary like this: $ file test1 test1: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.31, BuildID[sha1]=0x51b8d560584735be87adbfb60008d33b11fe5f07, not stripped When I try to run this binary

Call tree for embedded software [closed]

别等时光非礼了梦想. 提交于 2019-12-21 09:17:20
问题 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 7 months ago . Does anyone know some tools to create a call tree for C application that will run on a microcontroller (Cortex-M3)? It could be generated from source code (not ideal), object code (prefered solution), or at runtime (acceptable). I've looked at gprof, but there's still a lot missing to get it to work on an

Why strcpy() and strcat() is not good in Embedded Domain

我是研究僧i 提交于 2019-12-21 06:19:29
问题 Here i want to know about strcpy() and strcat() disadvantages i want to know about these functions danger area in embedded domain/environment. somebody told me we never use strcpy,strcat and strlen functions in embedded domain because its end with null and sometimes we works on encrypted data and null character comes so we cant got actual result because these functions stop on null character. So i want to know all things and other alternative of these functions. how we can use other

ARM Data Abort error exception debugging

别等时光非礼了梦想. 提交于 2019-12-21 05:11:27
问题 So now I understand that I'm getting a ARM Data Abort exception - I see how to trap the exception itself (a bad address in the STL library), but I would like to walk back up the stack frame before the exception. I'm using the IAR toolchain, and it tells me the call stack is unavailable after the exception - is there a trick way to convince the tool to show me the call stack? Thanks for all the quick help! 回答1: if you look at the ARM ARM (ARM Architecture Reference Manual, just google "arm arm

What is the minimum amount of RAM required to run Linux kernel on an Embedded device?

人走茶凉 提交于 2019-12-21 04:05:04
问题 What is the minimum amount of RAM required to run Linux kernel on an Embedded device? In Linux-0.11 for 80x86 , the minimum RAM required was 2MB to load the kernel data structures and interrupt vectors. How much is the minimum needed RAM for present Linux-3.18 kernel? Does different architectures like x86 and ARM have different requirements for minimum RAM required for booting? How does one calculates the same? 回答1: It's possible to shrink it down to ~600 KiB. Check the work done by Tom

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

混江龙づ霸主 提交于 2019-12-21 03:43:24
问题 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> ,

Is there a way of compiling C11 to C89?

こ雲淡風輕ζ 提交于 2019-12-21 03:35:40
问题 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.) 回答1: 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