embedded

How to get unique values at preprocessing across files

余生颓废 提交于 2019-12-07 02:10:44
问题 PROBLEM I need a way to generate unique values using a preprocessor directive. The aim is that each time the macro is called, it will have a unique integral identifier. But it should retain it's value across files. Kind of like a preprocessor counter for the number of times a call is made to the function. FURTHER INFO The macro I am using is: #define LOG_MSG(a) log_msg(?) 'a' is a string that the user wants to print. log_msg is a custom function used to print a message on the UART The '?' if

Which Cortex-M3 interrupts can I use for general purpose work?

血红的双手。 提交于 2019-12-07 01:47:09
问题 I'd have some code that needs to be run as the result of a particular interrupt going off. I don't want to execute it in the context of the interrupt itself but I also don't want it to execute in thread mode. I would like to run it at a priority that's lower than the high level interrupt that precipitated its running but also a priority that higher than thread level (and some other interrupts as well). I think I need to use one of the other interrupt handlers. Which ones are the best to use

Difference between arm-none-eabi and arm-linux-gnueabi?

夙愿已清 提交于 2019-12-06 22:40:13
问题 What is the difference between arm-none-eabi and arm-linux-gnueabi? I know the difference in how to use them (one for bare metal software, the other one for software meant to be run on linux). But what is the technical background? I see there is a difference in the ABI which is, as far as I understood, something like an API but on binary level. It ensures interoperability of different applications. But I don't really understand in which way having or not having an operating system affects my

Are global variables refreshed between function calls?

感情迁移 提交于 2019-12-06 21:26:08
问题 Im writing embedded firmware, and find it sometimes hard to decide when I need volatile or not. When I have a function that waits for some boolean flag to be changed by an interrupt, it's obvious that the flag needs to be volatile, because else the function would wait forever, since the compiler doesn't realise the value can be changed by the interrupt. But when I have a short function that just checks a flag in the first line, I would expect the flag doesnt need to be volatile, because its

Decode Base64 string to byte array

自作多情 提交于 2019-12-06 20:16:29
问题 I would create a python script that decode a Base64 string to an array of byte (or array of Hex values). The embedded side of my project is a micro controller that creates a base64 string starting from raw byte. The string contains some no-printable characters (for this reason I choose base64 encoding). On the Pc side I need to decode the the base64 string and recover the original raw bytes. My script uses python 2.7 and the base64 library: base64Packet = raw_input('Base64 stream:') packet =

infinite abort() in a backrace of a c++ program core dump

微笑、不失礼 提交于 2019-12-06 20:04:23
问题 I have a strange problem that I can't solve. Please help! The program is a multithreaded c++ application that runs on ARM Linux machine. Recently I began testing it for the long runs and sometimes it crashes after 1-2 days like so: *** glibc detected ** /root/client/my_program: free(): invalid pointer: 0x002a9408 *** When I open core dump I see that the main thread it seems has a corrupt stack: all I can see is infinite abort() calls. GNU gdb (GDB) 7.3 ... This GDB was configured as "--host

Qt Use Multiple Fonts at the Same Time

不打扰是莪最后的温柔 提交于 2019-12-06 19:36:58
问题 I have three fonts i want to use in my software: FontA: contains Latin, Greek, Cryllic characters FontB: contains Korean characters FontC: contains Japanese, Chinese characters These fonts have no overlap. I want to setup my application such that all of these fonts are used at once since characters from different languages may appear in the same context in my software. If a character is found in FontA, use it. Otherwise, look at FontB, if found use it. Look at FontC as last resort, if found,

STM32 WWDG interrupt firing when not configured

浪子不回头ぞ 提交于 2019-12-06 19:03:02
问题 I have an application that I am porting from the Keil IDE to build with the GNU toolchain due to license issues. I have successfully be able to set up, build, flash and run the application on the device. The application on the GNU side is for some reason is getting stuck in the weak linked IRQ handler for the WWDG which is an infinite loop. The application does not enable the WWDG, and it is disabled at reset by default. I have also verified that the configuration registers are at their

Looking for Example Embedded Linux HID Device Code

☆樱花仙子☆ 提交于 2019-12-06 17:04:27
I want to set up my embedded application as a HID device, with a separate process controlling the HID interface to allow dynamic connections to a PC. There seems to be many people out there that have done it, but I would like to do is: a) Understand how to configure my build (Freescale i.MX Linux using ltib) to include the USB APIs and includes in my build (ie g_hid.h). b) Where can I find an example application which does something like move the mouse about the screen to demonstrate the operation of the HID? Thanx for your help! http://lxr.linux.no/#linux+v3.3/Documentation/usb/gadget_hid.txt

How to find Logical Name for PinPad XFS if it is not mentioned in Manual

…衆ロ難τιáo~ 提交于 2019-12-06 15:37:12
I have started XFS implementation of SZZT Pinpad .I am facing an issue with the WFSOpen command Its giving an error “ – 14 “which is mentioned as WFS_ERR_HARDWARE_ERROR in the Manual. Please let us know if we are missing out on any parameter Value for the same . Also we are unable to find the logical Name for SZZT Pinpad in the Manual . As of now we are using the same name which is been mentioned in the Registry I've had recently this problem. In my case, it was due to the service provider not being found (more exactly, the SP implementation DLL). The reason behind, in my case, was that I was