embedded

How do I calculate distance between GPS co-ordinates on a processor with poor floating point support?

允我心安 提交于 2019-12-04 14:14:37
I need to calculate the distance between GPS co-ordinates to calculate distance traveled. I've tried both the Haversine and Vincenty algorithms, which work fine on my desktop PC, but when I port the code to the dsPIC, they return 0 for points that are close (within several meters) due to a lack of floating point precision and poor implementations of sin and cos. For my use case, my points will be no more than 10 meters apart and will all fall within 10km of each other. I've tried the following algorithm and the results seem ok: double dist(double latA, double lonA, double latB, double lonB) {

Lightweight encryption key exchange protocol

怎甘沉沦 提交于 2019-12-04 14:00:22
问题 I have an embedded system posting data to a JSON REST service via HTTP. I'm currently using HMAC-SHA1 for authentication, the same way that Amazon AWS does it. I'm now exploring options for encrypting the data in transit. HTTPS Seems like the logical choice as the server-end would need very little changed. However, my microcontroller has a relatively small flash (256KB) and RAM (96KB) and the only HTTPS clients I can find are commercial products. The microcontroller makes encryption simpler

Debug Linux kernel pre-decompression stage

僤鯓⒐⒋嵵緔 提交于 2019-12-04 12:59:44
问题 I am trying to use GDB to debug a Linux kernel zImage before it is decompressed. The kernel is running on an ARM target and I have a JTAG debugger connected to it with a GDB server stub. The target has to load a boot loader. The boot loader reads the kernel image from flash and puts it in RAM at 0x20008000 , then branches to that location. I have started GDB and connected to the remote target, then I use GDB's add-symbol-file command like so: add-symbol-file arch/arm/boot/compressed/vmlinux

Linking with static library not equivalent to linking with its objects

核能气质少年 提交于 2019-12-04 12:58:44
Problem: The firmware image generated when linking with a static library is different to the firmware image generated when linking with the objects directly extracted from the static library. Both firmware images link without error and load successfully onto the microcontroller. The latter binary (linked with objects) executes successfully and as expected, while the former (linked to the static library) does not. The only warnings during compilation are unused-but-set-variable in the manufacturer-supplied HAL, which due to various macro definitions are not necessary for the compiled

How to convert monochrome image to bitwise format for thermal printer

我怕爱的太早我们不能终老 提交于 2019-12-04 11:42:54
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. Please guide me. Pseudo code: Read BMP For each row in BMP For each group of 8 pixels in row output_byte

ARM Assembler - How do I use CMP, BLT and BGT?

笑着哭i 提交于 2019-12-04 11:39:14
问题 Quick question for you guys, in my loop I need to use CMP , BLT and BGT to compare some values. How would use said instructions in the following loop? I'm trying to use BGT , BLT and CMP as I need them to make my application work. The trouble is I have no idea how to use them. If I wanted to use CMP to compare r6, with r4 and put the difference into r7, how would I do this? The same question if I wanted to use BLT if r7 is less than 0, how would I do this? BGT ??????? ; branch if greater than

What would be a good open source lightweight c library with basic utility functionality to use in an embedded system [closed]

梦想与她 提交于 2019-12-04 11:39:09
问题 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 5 years ago . I'm thinking of something like glib, but possibly a slim version with a minimal foot print. It would need basic utilities such as linked lists, vectors and hash tables. It should also have a minimal runtime footprint. 回答1: Not exactly a library, but a tested, optimized and documented piece of code: sys/queue.h

What do the __CC_ARM, __ICCARM__, __GNUC__ and __TASKING__ macros mean?

梦想与她 提交于 2019-12-04 11:35:00
问题 I am working on STM32l151rct6a by stm, I have stumbled upon these MACRO definitions __CC_ARM, __ICCARM__, __GNUC__, __TASKING__ Does anyone know what they mean? 回答1: These are different compilers for ARM processors, probably these macros are used to hide compiler-dependent stuff in code that's compilable by several compilers. ICCARM --> IAR (there will also be a macro __IAR_SYSTEMS_ICC__ that is set to the compiler platform version __IMAGECRAFT__ --> Imagecraft C (also see Clifford's comments

Windows Embedded 8 Handheld (WE8H) Supported Devices

纵饮孤独 提交于 2019-12-04 11:30:55
Needed to find a way to create a "Kiosk mode" Windows 8 phone Application. After one and a half weeks of google intensive search, i've realized it is not possible to do. Then - Found two ways to workaround the problem - Kid's Corner. Windows 8 Embedded Handheld o.s. The second solution looks better to me. i've found the Windows 8 Embedded Handheld SDK, and now i have the ability to start coding. but, one second before i start, i couldn't find any device who supports this o.s (?!?) does some one know any device? thank. Panasonic allegedly have a device due out in June 2014. http://akihabaranews

Using <chrono> as a timer in bare-metal microcontroller?

我与影子孤独终老i 提交于 2019-12-04 11:18:42
Can chrono be used as a timer/counter in a bare-metal microcontroller (e.g. MSP432 running an RTOS)? Can the high_resolution_clock (and other APIs in chrono) be configured so that it increments based on the given microcontroller's actual timer tick/register? The Real-Time C++ book (section 16.5) seems to suggest this is possible, but I haven't found any examples of this being applied, especially within bare-metal microcontrollers. How could this be implemented? Would this be even recommended? If not, where can chrono aid in RTOS-based embedded software? I would create a clock that implements