embedded

snprintf() prints garbage floats with newlib nano

久未见 提交于 2019-12-06 01:44:41
问题 I am running a bare metal embedded system with an ARM Cortex-M3 (STM32F205). When I try to use snprintf() with float numbers, e.g.: float f; f = 1.23; snprintf(s, 20, "%5.2f", f); I get garbage into s . The format seems to be honored, i.e. the garbage is a well-formed string with digits, decimal point, and two trailing digits. However, if I repeat the snprintf , the string may change between two calls. Floating point mathematics seems to work otherwise, and snprintf works with integers, e.g.:

malloc in embedded systems [duplicate]

荒凉一梦 提交于 2019-12-06 01:43:13
问题 This question already has answers here : Dynamic memory allocation in embedded C (3 answers) Closed 3 years ago . I am working with an embedded system. The application is running on AT91SAMxxxx and cortex m3 lpc17xxx. I am looking into dynamic memory allocation as it would dramatically change the face of the application (and give me more Power). I think the my only real route is to set out an area of memory for a heap and design a tailored malloc that best fits (pun) my purpose. When looking

STM32F207 I2C test failing

流过昼夜 提交于 2019-12-06 01:25:00
I am learning embedded development on the STM3220G-EVAL board with the STM32F207 microcontroller. I have tried to test the I2C interface by interfacing the two I2C2 and I2C3 modules on the same chip and sending/receiving a character. Here is the code I have currently written (using mdk-arm 5): #include <stm32f2xx.h> volatile uint8_t data = 'a', recv = 'x'; void i2c_init(void); void I2C2_EV_IRQHandler(void) { volatile uint16_t stat, dummy; stat = I2C2->SR1; switch(stat) { // SB set; read SR1 and write slave address in DR to clear case 0x01: dummy = I2C2->SR1; // Send address of slave I2C2->DR =

Ultra-portable, small complex config file library in ANSI C?

随声附和 提交于 2019-12-06 00:19:48
问题 I'm looking for a very portable, minimalistic/small XML/configuration language library in ANSI C with no external dependencies (or very few), compiling down to less than 100K. I need it for a moderately complex configuration file, and it must support Unicode. Some more requirements: OK to use/embed/statically link into proprietary code . Credit will always will be given where credit is due. Not necessarily XML. Really, clean code /no weird or inconsistent string handling. UTF-8 . Thank you

How can I enable Xcode refactor options for an external build project?

人走茶凉 提交于 2019-12-05 23:33:16
I want to use XCode as an IDE for developing some AVR code. I did the following 1) create new project 2) select external build system 3) indicated i want it to be make, and told it NOT to "Pass build settings in environment" 4) copied my .c/ .h/Makefile into the same directory i created the project in 5) added the .c/ .h files to the project/target 6) verified that i can build (make) from both command line and Xcode But I cannot use any of the refactor menu options, or jump to/reveal options. There appears to be no symbol information. Is there no way to use Xcode as more than just a simple C

QT5 eglfs on embedded linux (TI am355x evm starter kit)

无人久伴 提交于 2019-12-05 23:12:27
I’ve just cross-compiled QT 5.2.1 for ARM and I am using it on a TI AM335x EVM (Starter Kit) board. I’de like to use the eglfs platform, but unluckily it shows some artifacts on the screen… I just made a simple program for showing the problem and captured some photos of my screen. The program basically draws a set of vertical black and white lines (alternated). If I run QT on platform linuxfb (that is I launch my program passing “-platform linuxfb” on command line) then the software works fine… Here is a photo of my screen: If instead I run QT on platform eglfs (that is I launch my program

High performance logging library for embedded applications

白昼怎懂夜的黑 提交于 2019-12-05 21:15:59
I am looking for a high performance logging library that I will use on an embedded device. I also want to say that I previously used PaulBunyan logging library which provided an efficient method for transferring information. [By efficient I meant it had a solution for transferring only the __LINE__ and __FILE__ when sending data through a low speed interface (SERIAL for example) - of course a __LINE__ __FILE__ mapping was previously made by scanning the code]. Do you know such solutions or at least similar ones? Thanks in advance for any pointers/similar solutions, Iulian The decision is to

General JTAG working flow in an embedded development system?

耗尽温柔 提交于 2019-12-05 20:45:09
In my embedded project am using JTAG interface to download the code and to debug the downloaded application.But i don't know what is happening inside the JTAG set up. Can anyone please give me basic idea/flow(high level view) of the JTAG set up wich will really help me to understand my development system better. __Kanu To add to Cliffords answer, there are some pictures here: http://www.fpga4fun.com/JTAG2.html The tap controller state machine is something you will see published ad nauseum. It is really the key to JTAG. As Clifford said you access on chip debug registers. The tap controller

Keyboard input in Qt

别来无恙 提交于 2019-12-05 18:49:44
I am working on a Qt application running on embedded Linux. I am pretty new to this Qt business since I have just started it a month back, so understand that I'm not that object-oriented ... :P I have the Qt applications running on my target running Linux. The Qt documentation http://doc.qt.io/archives/qt-4.7/qt-embedded-pointer.html says that we have to enable touchscreen, USB keyboard, keypad, etc. by exporting certain variables. Namely, export QWS_MOUSE_PROTO=tslib:/dev/input/event1 export QWS_KEYBOARD="linuxinput:/dev/input/event0 usb:/dev/input/event2" well, as you can guess, first line

Initializating SanDisk SD card using SPI fails after doing HW reset

狂风中的少年 提交于 2019-12-05 18:49:35
I am using an STM32 micrcocontroller to interface an SD card memory using the SPI peripheral. I have done tests with 2Gb , 4Gb , 8Gb and 16Gb SanDisk cards. When I perform a reset with the 2Gb and 8Gb cards , nothing happens and I keep going with my tests. However, with 4Gb and 16Gb , once the reset is performed intialization fails . In fact , at the first insert in the SD slot , these cards are quite good initialized but one I perform the reset it does'nt pass. When I tried to debug this problem, I discovered that when dealing a reset the response to command CMD0 is wrong . I get 0x00 instead