embedded

How to debug the Linux kernel with QEMU and KGDB?

偶尔善良 提交于 2019-11-30 14:12:55
问题 I have been able to boot a powerpc based system (MPC8544DS to be specific) using the following way to invoke qemu (v1.7.0) qemu-system-ppc -M mpc8544ds -m 512 -kernel zImage -s -nographic -initrd busyboxfs.img -append "root=/dev/ram rdinit=/bin/sh kgdboc=ttyS0,115200 kgdbwait" where zImage is a custom cross compiled Linux Kernel (v2.6.32) which has KGDB enabled and compiled in (for startupcode debugging) and busyboxfs.img is the busybox based rootfs. Since I'm using the -s flag to Qemu, I can

Circular Buffer in Flash

做~自己de王妃 提交于 2019-11-30 14:02:12
I need to store items of varying length in a circular queue in a flash chip. Each item will have its encapsulation so I can figure out how big it is and where the next item begins. When there are enough items in the buffer, it will wrap to the beginning. What is a good way to store a circular queue in a flash chip? There is a possibility of tens of thousands of items I would like to store. So starting at the beginning and reading to the end of the buffer is not ideal because it will take time to search to the end. Also, because it is circular, I need to be able to distinguish the first item

How do you start running the program over again in gdb with 'target remote'?

☆樱花仙子☆ 提交于 2019-11-30 13:43:20
问题 When you're doing a usual gdb session on an executable file on the same computer, you can give the run command and it will start the program over again. When you're running gdb on an embedded system, as with the command target localhost:3210', how do you start the program over again without quitting and restarting your gdb session? 回答1: You are looking for Multi-Process Mode for gdbserver and set remote exec-file filename 回答2: Unfortunately, I don't know of a way to restart the application

Is there a way to load a binary file as a const variable in C at compile time

我怕爱的太早我们不能终老 提交于 2019-11-30 13:39:39
I was wondering if there is a way to load an external binary file as a variable in C through an include or a header file or something of the like. For example, in a project I am currently working on I am working with an embedded system that has a graphic display that will do text and minor graphics (boxes, lines, etc.) using ASCII data and commands. But, it will also display monochrome bitmaps. So I have a series of static displays that I use for a user interface, and a couple of bitmaps for splash screens. Now the reason I mention that it is an embedded system is that there is no file system

How to determine maximum stack usage in embedded system?

≯℡__Kan透↙ 提交于 2019-11-30 12:52:28
When I give the Keil compiler the "--callgraph" option, it statically calculates the exact "Maximum Stack Usage" for me. Alas, today it is giving me a "Maximum Stack Usage = 284 bytes + Unknown(Functions without stacksize...)" message, along with a list of "Functions with no stack information". Nigel Jones says that recursion is a really bad idea in embedded systems ( "Computing your stack size" 2009), so I've been careful not to make any mutually recursive functions in this code. Also, I make sure that none of my interrupt handlers ever re-enable interrupts until their final return-from

What' s the difference between <= and := in VHDL

丶灬走出姿态 提交于 2019-11-30 12:45:04
Currently, I am learning some FPGA design techniques using VHDL, my problem is whether we can use := and <= interchangeably in VHDL or not, though I've seen the use of := in constants declarations and <= in assignments? Thanks in advance! The rules are a little more complex than this, but basically: you use <= to do signal assignment, which takes effect on the next delta cycle. You use := to do variable assignment, which takes place immediately. So if you have a signal, you always use <= . If you have a variable, you always use := . Some places where this is not quite that case that you will

Using floats with sprintf() in embedded C

走远了吗. 提交于 2019-11-30 12:10:20
问题 Guys, I want to know if float variables can be used in sprintf() function. Like, if we write: sprintf(str,"adc_read = %d \n",adc_read); where adc_read is an integer variable, it will store the string "adc_read = 1023 \n" in str (assuming that adc_read = 1023 ) How can I use a float variable in place of integer? 回答1: Since you're on an embedded platform, it's quite possible that you don't have the full range of capabilities from the printf() -style functions. Assuming you have floats at all

Device misdetected as serial mouse

♀尐吖头ヾ 提交于 2019-11-30 12:03:05
问题 I'm working on a device which communicates with a PC through a (virtual) serial port. The problem is that the data we are sending occasionally gets incorrectly identified by Windows as a bus mouse, after which the "Microsoft Serial Ballpoint" driver is loaded and the mouse pointer starts jumping around on the screen and randomly clicking on things. A bit of Googling reveals that is an old and well-known problem with serial devices where the usual work-around is a bit of registry hacking to

C# for embedded systems? [closed]

此生再无相见时 提交于 2019-11-30 11:57:05
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . "C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions." -- design goals (wikipedia) Although it greatly depends on

What is the best Evaluation Kit for Learning Embedded C/C++ Development? [closed]

依然范特西╮ 提交于 2019-11-30 11:37:30
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I am trying to improve my embedded C/C++ development on ARM architecture. I have recently moved from 68K development to ARM and wanted