embedded

Can an implementation consider hints as actual statements?

最后都变了- 提交于 2019-12-20 05:12:59
问题 In C, the register storage qualifier is an hint to the implementation that such identifier should be accessed as fast as possible (e.g. stored in a CPU register). §6.7.1 A declaration of an identifier for an object with storage-class specifier register suggests that access to the object be as fast as possible. The extent to which such suggestions are effective is implementation-defined. and §6.7.3 The intended use of the restrict qualifier (like the register storage class) is to promote

sqlite3 columns types

橙三吉。 提交于 2019-12-20 04:50:27
问题 I'm starting a new project that has to convert data from XML to db . XMLs have their own format and cannot be used to fill a db . I choose to use sqlite , because it is an embedded platform and I need a lightweight library. I'm struggling with columns types. I wrote the sql below: static int callback(void *NotUsed, int argc, char **argv, char **azColName) { int i; for(i=0; i<argc; i++){ printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL"); } printf("\n"); return 0; } static bool exec

C++ dynamic code injection on an embedded system

核能气质少年 提交于 2019-12-20 04:48:32
问题 I am looking for a solution to the following problem: a C++ software module is developed that runs on an embedded device (no possibility to use the file based function "dlopen" to load shared libraries), while the module is running it shall be extendable by dynamic program code the dynamic code is written (realization of interface functions) and cross compiled (gcc) on a PC system before it is sent via a bus system to the previously described software module running on the embedded device the

Create new C library in lua

不想你离开。 提交于 2019-12-20 03:56:08
问题 I want to know how i can create and use a new C library in lua 5.2.3. I can't use dynamic library (require, shared library, ...) due to I am on an embedded system. I found an answer but it is for lua 5.0 (http://www.lua.org/pil/26.2.html) and so it is not compatible. If someone have a idea ? 回答1: Edit linit.c and add your library entry point to it. Then add the modified linit.c to your project. The linker will use your copy instead of the one in the Lua library. This assumes your app calls

md5 implementation for non-byte addressable arch?

家住魔仙堡 提交于 2019-12-20 03:44:10
问题 The common implementation for MD5 is given by RFC1321. Where the MD5Update function receive a pointer to chars . My architecture, a SHARC ADSP-21371, is not byte adressable which means: sizeof(int32_t) == 1 Thus I cannot really use this algorithm as is. I need to wrap some complexity to unpack each int32_t data. Is there an alternative solution that I can use out of the box and if possible compatible C99 or C11? 回答1: I finally implemented MD5 for a octet-addressable architecture, here is for

Initialization of arrays in C

北城以北 提交于 2019-12-20 03:09:48
问题 In C, I have read that half-initialized arrays will be filled with zeros for the rest of the elements (irrespective of integer or char arrays). E.g.: int arr[10] = {3}; arr[4] will be 0 if initialized and a junk value if not initialized. My question is, will the above work for all C compilers (or) this appending of zeros might occur or not occur depending on the compiler option? I am working in Code composer studio (TI's IDE). I want to ensure that this will work for all cases and all

How do I write to a memory-mapped address in Rust?

穿精又带淫゛_ 提交于 2019-12-19 13:56:52
问题 I'm trying to make "Blinky" for STM32F1xx in Rust. I know that there are libs for it, but I want to make my own "lib" for learning purposes. I can access STM32's "registers" by their addresses like this in C: *(uint32_t*)(0x40021000 + 0x018) |= 0x10; *(uint32_t*)(0x40011000 + 0x004) |= 0x33; *(uint32_t*)(0x40011000 + 0x004) &= ~0xCC; *(uint32_t*)(0x40011000 + 0x10) |= 0x300; while(1) {} This writes some bits to the RCC_APB2ENR register to enable clocking of port C, configures pins and enables

representation of MAC address in C code

与世无争的帅哥 提交于 2019-12-19 06:39:05
问题 I often see such representation of MAC address in C code: struct mac_addr { unsigned char bytes[6]; } Why necessary put an array in a structure, why not just have an array? What benefit does this provide? Thanks. 回答1: You can't assign an array in C. But you can assign a struct. 来源: https://stackoverflow.com/questions/19482750/representation-of-mac-address-in-c-code

Unable to shutdown embedded activeMQ service using the built in BrokerService.stop call

一曲冷凌霜 提交于 2019-12-19 06:03:24
问题 I have been using an embedded activeMQ server configuration (configuration is very similar to the examples that illustrate the concept of an embedded activeMQ server/listener). Aas part of the application, I have a monitoring thread that monitors a directory. Instead of having to kill the process to shutdown the activeMQ server, I introduced a check for a "STOP" file and if the file exists, the server would shutdown. The shutdown I am trying to accomplish by calling the stop function on the

how to rebuild rootfs in buildroot

心已入冬 提交于 2019-12-19 02:43:11
问题 I am going to setup build environment to make my own linux embedded system for AT91SAM9X25 Board. I am using buildroot to do this. The make command build all targets, the first it build toolchain then packages and then rootfs and images of rootfs (tar, cpio ...). To rebuild rootfs I usually use make clean and then make. The make clean command removes all and including toolchain. So the first my question is: Is there some way to remake rootfs without building toolchain? It takes a lot of time.