FAQ Database Discussion Community


How can I align stack to the end of SRAM?

c,embedded,stm32,gnu-arm,coocox
I have a STM32F103VCT6 microcontroller with 48kb of SRAM, and recently i've got a memory collision: I have some static variable (lets call it A) located in heap with size of 0x7000 and I wrote some simple function to get info about stack and heap: void check(int depth) { char...

How to read a button in cerebot Mx7ck without using polling in freeRTOS? [closed]

embedded,microchip,freertos,pic32
I am novice to freeRTOS. I am currently working on a project that uses cerebot Mx7ck(PIC32) running freeRTOS. I need to read buttons using some events(i.e using button input as input event)? But I am not allowed to use polling technique or ISR available in freeRTOS. Professor suggested to use...

Casting to pointer warning

c,embedded
I defined variables display_address, version, serial_no[] as uint8_t and forwarded them to function, that variables need to be pointers so I casted it (uint8_t *)variable, and after that I'm getting a warnings warning: cast to 'uint8_t *' (aka 'unsigned char *') from smaller integer type uint8_t (aka 'unsigned char') What's...

Embedded system debugging - Should I use an output/log file?

c,debugging,embedded
I am fairly new to embedded systems, though not to programming. We manage large lists of different data structures in our application, that we fill with data parsed from incoming arrays of characters. For debugging, looking the watch for each structure doesn't seem very practical and I've thought of building...

how to get a clock from a device tree node

c,linux-kernel,embedded,linux-device-driver,device-tree
I have the following issue: I want to define the clock a CPU should use during frequency transitions in the device tree rather than in the clock driver code (in this way it will be more generic). I want to define the "transition-clock" property in the device tree, something like:...

How can I change maximum available heap size for a task in FreeRTOS

embedded,malloc,heap,keil,freertos
I'm creating a list of elements inside a task in the following way: l = (dllist*)pvPortMalloc(sizeof(dllist)); dllist is 32 byte big. My embedded system has 60kB SRAM so I expected my 200 element list can be handled easily by the system. I found out that after allocating space for 8...

How to store text file on embedded systems flash memory and read from it

c++,embedded,keil,freertos
I'm trying to do the following: Storing a text file (7kB) in the flash memory of a STEVAL-MKI109V2 (running with freeRTOS) board and read this text file and doing some computation with it on the device itself. I have 2 problems regarding that: 1) Storing the text file Is it...

Issue in Bluetooth pairing

bluetooth,embedded,windows-ce,windows-embedded-compact,hci
We are testing Bluetooth in WEC2013 with a USB based dongle from generic vendor on iMx6 platform. We are using the default HCI Transport layer provided with WEC2013 BSP. BT is turned on and able to scan all the nearby devices. We have enabled following set of sysgen variables and...

Ownership of frame in buffer - C programming

c,embedded
I am programming interface between HW and SW. I know what should I get as result, and now I am thinking how to make it most efficiently. I have sort of circular FIFO buffer in which Operating System will write data, and HW will read data from it. So basically...

Undefined reference to pico_dhcp_server_initiate when compiling PicoTCP for ARM mbed

c++,c,compiler-errors,makefile,embedded
I'm working on a project where I have to work with PicoTCP (see https://developer.mbed.org/users/daniele/code/PicoTCP/, I'm using an older version of this library). In my main.cpp file, I have the following code: #include "pico_stack.h" #include "pico_dhcp_server.h" int main(void) { // create DHCP server struct pico_dhcpd_settings s = { }; s.my_ip.addr =...

Why NOP/few extra lines of code/optimization of pointer aliasing helps? [Fujitsu MB90F543 MCU C code]

c,optimization,debugging,embedded
I am trying to fix an bug found in a mature program for Fujitsu MB90F543. The program works for nearly 10 years so far, but it was discovered, that under some special circumstances it fails to do two things at it's very beginning. One of them is crucial. After low...

How far should one take #ifdef statements for hardware flexibility [closed]

c,coding-style,arduino,embedded
As I understand it, one of the best ways to include different options for different hardware in an embedded systems program is #ifdef statements. Stylistically, how far should this go? I guess specifically, would you shake your head if someone uses an #ifdef on a function deceleration? It feels quite...

Can an implementation consider hints as actual statements?

c,embedded,language-lawyer
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...

STM32 flashing disabled after flashing a code without R/W protection

embedded,stm32
I have some experience of StdPeriph libraries usage for programming stm32. But now I tried STM32Cube HAL with STM32CubeMX code generator. I generated a project with this options: Middleware: FreeRTOS and FatFS via SDIO Compiler is GCC stm32f103ret6 MCU I imported generated code to Eclipse environment. I made a binary...

snprintf() prints garbage floats with newlib nano

c,arm,embedded,printf,newlib
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...

static global structure variable value changes to FF

c,embedded,keil
I have a static global structure variable say Struct1 in a file which is modified only in the file(say Struct1file.c) I have a State Machine in the same file(Struct1file.c) which is called within a task(Struct1Task) after every 1ms. This State Machine has functions which access and changes the value of...

FTP File upload from Memory in C

c,ftp,embedded
I'm programming an embedded software in C (not C++) that allows me to transfer a file to the ftp (some readings that a specific hardware does), but it seems I don't know how to do the transfer. This is my code: ///pasive connection FTP sprintf(szBuf, "PASV\r\n"); FTP_SendCmd(szBuf); if(!FTP_RecvResponse()) return FALSE;...

Building firmware Patch for embedded applications

c,linker,embedded,firmware,iar
I have a library stack that is not going to change, and an firmware that is going to use only this stack. Firmware will change alot along the way. I don't want to every time release the whole image(including library stack) because of limited memory and resources issue(This is an...

CC2541 IAR Output

c,embedded,iar,texas-instruments
To begin, I am working on CC2541 IAR 8.20 for 8051. I would like to write in output or file for check the communication between my application and the device. Even if I have the CC-Debugger and I know if I do View -> Messages -> Tool Output, its output...

PORT Mapping, Memory Mapping

assembly,embedded,microcontroller,firmware
Can any one explains me clearly, what is mapping? Port mapping? Memory mapping? In firmware development. I gone through many other sites, still the question is not clear. Asked in an interview for Firmware Developer. The actual question is "How does you access data holding in the register/memory of a...

Portable function in C (with no assembly) that returns the size of its stack frame

c,embedded,stackframe
Write a portable function in C (with no assembly) that returns the size of its stack frame int stackframe_size() { } Attempted solving it as below - This function returns 228 bytes when compiled with VS 2010. Is there a way to verify its correctness? int stackframe_size(int run) { int...

Remote connection to embedded device in field

login,ssh,embedded,ethernet
I would like to ask about the way how to establish remote connection to Linux based embedded device in the field. I have a small linux board I want to place in remote location. It has an internet access through ethernet. Than I have a Linux server with public IP...

Building in PC a C struct for an embedded target

c,xml,parsing,embedded
I need to extract data from an XML and link it as a struct to a C embedded project. The XML is unavailable in runtime. (no file system, file is too big, and security reasons). So I have to parse it and generate the struct on my PC pre-linkedge. If...

MSP430 Random Resets with 'Security Violation (BOR)'

c,embedded,reset,msp430
I am facing RANDOM controller resets and the 'SYSRSTIV' register gives value '0x0A' which means 'Security Violation (BOR)' according to user's guide. I searched many forums and found few topics related to the issue but that didnt help. Details: Controller used : MSP430F6634 Issue: Random Reboots Assumptions > Nested ISR...

Realloc() Unable to understand even after lots of reading

c,memory,embedded
I am writing a simple task scheduler and using dynamic memory allocation on my Texas Instruments cc430F5137 which has 4kB RAM. I agree that it is not a good practice but for the time being lets assume it is my application requirement to use dynamic memory allocation. In my OS.c...

ATtiny85 digital “on” output fails to deliver 5 V

c++,c,embedded,gpio,attiny
I am using an ATtiny85 as a micro-controller. I am trying to read two inputs at around 3 V each and output 5 V for every "on" input (more than 1V). I'm using PINB0 & PINB1 for input and PINB3 & PINB4 for output. The problem is when both PINB0...

Led on/off using PIC 16f777a

embedded,pic,led,hi-tech-c
I am doing an exercise using push button. When the button is pressed once the led starts blinking and when it is pressed again it stops. When I tried the led is blinking on 1st press but it is not stopping on 2nd. I am using PIC16F877A MCU with HiTech...

Bridging ethernet traffic between two interfaces (USB-CDC ECM and Ethernet) using an mbed LPC1768

linux,networking,embedded,wireshark,ethernet
I'm working on a project where I have a LPC1768 MBED device. I can connect this device by USB with the computer. The device itself has a working outgoing Ethernet connection which I can read using the MBED library. On the embedded device, internet traffic enters with the USB-CDC ECM...

How do I suspend an i2c device in Linux from userspace?

c,linux,kernel,embedded
I am attempting to put a particular device into suspended mode, and have been unable to find a way to do this. I see in the kernel that a suspend command can be defined, but what is the user space analog to it, if there is one? In this case,...

How to find offset in a sine lookup table (LUT) using fixed point arithmetic

algorithm,embedded,lookup-tables,fixed-point
I am generating a LUT dividing 0-2PI into 512 fragments and then finding sine of these values and storing them as Q1.31 values. Example: LUT[0] = 0 LUT[1] = sin((1/512) * 2*PI) * (2^31) .. .. LUT[511] = sin((511/512) * 2*PI) * (2^31) My inputs are also values in the...

Sobel Edge Detection without a buffer

c++,image-processing,embedded
For an embedded design I am attempting to implement sobel's edge detection on a board without the use of a buffer. i.e. I am reading and writing directly from the screen. I can however, store about one or two imge width full of data to be referenced later. This is...

Deployment over GPRS to embedded devices

linux,git,deployment,embedded,rsync
I've got quite a head scratcher here. We have multiple Raspberry Pis on the field hundreds of kilometers apart. We need to be able to safe(ish)ly upgrade them remotely, as the price for local access can cost up to few hundred euros. The raspis run rasbian, / is on SD-card...

Zxing QR Scanner Embeded disable beep sound

java,android,android-studio,embedded,zxing
I have integrated Zxing QR Scanner in my Android app using the instructions here: https://github.com/journeyapps/zxing-android-embedded ( Adding aar dependency with Gradle) Everything works great with the scanner but when the scan is succesfull and the phone media volume is not on mute the app generates a beep sound. Can you...

Can Someone say what actually “Platform” means?

c,operating-system,embedded,platform
I am new to embedded and I am confused with this word "Platform" whether it specifies about the 'board' or 'Operating system'? for example some says like "I am working on windows platform" and some says like "The platform I am using is rasperri pi" etc. I know this is...

Is it possible to program an Arduino from another embedded device?

arduino,embedded,upgrade
I am currently working on a system (home projects - finally got the time yay!) and i am wondering whether it would be possible to program an arduino from a pic32? the system currently has both and given the pic32 proc has an SD card attached, i figured i could...

C programming without malloc

c,arm,embedded
I have to write white complex application for embedded device in C. Runtime (libc) does not support malloc/calloc/realloc/free or any other kind of dynamic memory management. What are best practice for such cases? Edit: Application is complex. for instance, it should do public key cryptography. Device is specific ARM-M0 based...

C Struct Formatting/alias

c,struct,embedded
I'm a beginner in C and I came across some codes in a header file that I'm not sure what style it uses and what it means. typedef struct tActiveObject *testActiveObjectPtr; typedef struct tActiveObject { ActiveObject ao; int state; } testActiveObject, *testActiveObjectPtr; Why do we need to create a pointer...

After making function call in the programme ,control is jumping into the unspecified memory location

c,gps,arm,embedded
i am developing a gps code which takes the raw data from the gps and decodes the data and saves it into the respected variables(arrays).The problem is whenever i make the function call,it is executing the function statements upto the end of the function ie., "}" ,and after that the...

Writing to flash ROM for an embedded OS on atmega328p (h8write equivalent for avr)

arduino,embedded,avr,rtos,atmega
I'm currently reading a Japanese book on embedded OS/RTOS es except that I am not using the recommended hardware as I already had a seeeduino microcontroller.(atmega328p) The book is about KOZOS "12 steps to making your own embedded OS" by Sakai Hiroaki(It's hiro-something) I'm stuck at the part where I...

Ideas for embedded application that uses POST and GET to interact with the internet [closed]

html,embedded,iot
I am trying to do a project where I use POST and GET html requests to do something cool on the internet. I am using an alpha version of a Redpine signals board (they gave use exclusive access for a class at my university). My problem is I don't really...

Using nandflash with hardware ecc in Win CE6

embedded,windows-ce,windows-embedded-compact
Currently, I am adapting a Win CE6 device to a new nand flash chip. The new nand has higher ecc requirements (4 bit / 512 bytes) and supports on chip ecc calculation. Microsoft flash filesystem writes to sectors without erasing them. This happens when writing it's status information in SectorInfo->wReserved2....

Identical (almost) ELF headers but executables won't run on each other's system

c,linux,embedded,mips
I'm trying to compile a couple of programs for a little embedded device I own. It's a Little-endian MIPS (mipsel) processor. I retrieved this executable from it via telnet and the builtin ftp client: [email protected]:/home/user/wansview/devel# readelf -h unzip1 ELF Header: Magic: 7f 45 4c 46 01 01 01 00 00...

C Global declared in ISR

c,arm,embedded,cortex-m,codewarrior
I am evaluating Freescale's Kinetis Design Studio for their ARM series microcontrollers. I was looking at an example as a basis to do my first "blink an LED" project. When using variables shared between my main program and an ISR such as a counter, I would typically define a volatile...

How can I improve my ad hoc cruise control system for Nios 2?

c,embedded,nios,quartus-ii,ucos
I have written in Nios 2 an ad hoc cruise control system for a school assignment. I versioned it with github. We want the cruise control to differ at most 2 m/s for speeds >= 25 m/s. The latest improvement I could do was checking the velocities in the condition...

does arduino run the print function (print, println, printf, etc.) when no COM (Serial) port is connected or serial monitor open?

c,arduino,embedded,processing,atmega
Im wondering the print statements in my code are taking up processing cycles when the robot isn't connected to the com port. I am running a time sensitive process and have reason to believe the execution of these lines could be slowing my bot down.

Running a C Program with No OS on Raspberry Pi

c,arm,embedded,raspberry-pi,low-level
I'd like to experiment using the Raspberry Pi for some different low level embedded applications. The only problem is that, unlike the AVR and PIC microcontroller boards available, Raspberry Pi typically runs an OS (like Raspbian) that distributes CPU time across all running programs and makes it impractical for certain...

Sofware pwm as linux kernel module

c,linux,linux-kernel,embedded,pwm
I need to implement PWM-module for linux kernel, it should be high resolution ( will be cool more than 10kHz on my 400MHz ARM cpu) Can anyone give me an advice, what I can use for that purpose? Kernel version is 2.6.28.9. Device hasn't a harware PWM driver. Now I...

Custom GUI - Scrollable Text View

c,user-interface,embedded
I'm creating a GUI to run on a STM32F429 microcontroller, it is written in C. The problem I'm having is how to manage scrolling for a text view. I have a data buffer with ASCII characters and I want to manage the newline character (\n, ASCII code 10) so that...

Is there any open hardware microcontroller?

embedded,hardware,microcontroller
Is there any open hardware microcontroller?. I can't find something about this. I mean microcontroller which i can buy from vendors or somewhere and i can download and see full scheme of it. And this information enough to emulate it. something like it....

MISRA incrementation in C

c,pointers,embedded,misra
While debugging some embedded code, I came across something like this: buffPtr = &a[5]; buffEndPtr = &a[10]; while (buffPtr != buffEndPtr) { *buffPtr = 0xFF; buffPtr = &buffPtr[1]; /* MISRA improvement for: buffPtr++ */ } Why would this construct be an improvement over (*buffPtr)++ ?...

embedded C #define

c,arm,embedded,cmsis
In embedded C, I ran into the following (and many more similar) example: #define GPIOA_AHB ((GPIOA_AHB_Type *) GPIOA_AHB_BASE) GPIOA_AHB_BASE is an address, and it is defined previously. What does this code precisely do? I know defines are directive for the preprocessor, so that it replaces all instances with the value...

Flashing a C program to ARM

c,arm,embedded
I just started programming for an ARM Processor and I have never been this clueless. There are a couple of example projects that came with the board (ADucm350) and I wanted to upload one of them. I downloaded Keil (or I think it's just the project management software part of...

Memory map shows space allocated to mystery variables _powers_ and _npowers_

c,embedded,microchip,xc16
I've been looking at the memory map for my code (written in c and compiled by the XC16 compiler), and see significant space allocated to powers, npowers, and dpowers in the .data segment. Does anyone know what this allocation is used for? My code uses the floating point library, as...

Copying specific data to particular position in another variable

c,embedded
I want to copy certain number of bits from a variable to certain position in another variable Example: I have 8 bit of data. I want to extract higher 4 bits of this byte and transfer them to a 32 bit data variable from bit position 19. How best this...

imx6 Device Tree compilation — FATAL ERROR: Unable to parse input tree

linux,embedded,device-tree
I am working on Embedded Linux for TX6U-8010 based on Freescale imx6. I am trying to compile dtb using the device tree compiler (dtc). However when I use the command: dtc -O dtb -o imx6dl-tx6u-801x.dtb imx6dl-tx6u-801x.dts ...I get the following error: Error: imx6dl-tx6u-801x.dts:13.1-9 syntax error FATAL ERROR: Unable to parse...

Allocating an object for C / FFI library calls

c,embedded,rust
I have a C library, which has gpio implementation. There's gpio_type which is target specific, each MCU has different definition for gpio_type. One of the functions in the library: void gpio_init(gpio_type *object, int32_t pin); I want to write abstraction of Gpio object in Rust, using C library functions. Therefore need...

How to connect to my LaunchPad TM4C123G

embedded,microcontroller,texas-instruments
I have spent some time trying to connect to my LaunchPad TM4C123G using the mspdebug toolchain on my macbook (10.10), but no luck. While trying to run $ mspdebug rf2500 I get usbutil: unable to find a device matching 0451:f432 I did some googling and it seems to me the...

Start an Android App when an “unknown tag type” is scanned

android,embedded,nfc,spi
I am working on an Android NFC reader project in which I use the AS3953 NFC chip. according to the datasheet: This NFC chip could be used Where log data is stored periodically by the microcontroller and can then be read by the PCD even when the microcontroller is not...

STM32F103 hangs on page update with USART enabled

embedded,stm32,cortex-m3
I am currently working on a STM32F103, and I want to program the flash. However, it appear that programming the flash with an USART device receiving bytes in the same time make it hangs: FLASH_BASE->CR |= FLASH_CR_PER; while (FLASH_BASE->SR & FLASH_SR_BSY); FLASH_BASE->AR = pageAddr; FLASH_BASE->CR |= FLASH_CR_STRT; // Hangs forever...

Android: What is meaning of Uniform, mat4 and vec4 in Open GL ES?

android,opengl-es,embedded,shader
In this code (from Android Developer website): private final String vertexShaderCode = "uniform mat4 uMVPMatrix; \n" "attribute vec4 vPosition; \n" + "void main(){ \n" + " gl_Position = uMVPMatrix * vPosition; \n" + "} \n"; What is meaning of uniform and mat 4? and What is meaning of attribute and...

Changing just one byte in SD card sector

c,embedded,avr
I'm implementing FAT16 on SD card with Atmega328. I often need to change just one or two bytes in the sector (512B region). I know how Flash works and that it needs to overwrite entire sector at once, but I was wondering if there maybe was some special command that...

Redirecting Ethernet traffic through another interface

routes,embedded,protocols,ethernet,dhcp
I'm working on a project where I want to redirect ethernet traffic through another interface. The setup is as follow: I have a computer with a working internet connection. I also have a MBED LPC1768 board which I can connect by USB with my computer. I can upload a binary...

add instructions to 8051 architecture

embedded,microcontroller,electronics,8051,microprocessors
As you all know, most of the 8051 emulation/simulation softwares emulate 8051 Processor architecture. Is there any such tool, which can append some extra Instructions into the 8051 Processor architecture and do some simulations and debug the codes. OR, if there is any method of doing this, you can suggest,...

EnergyMicro and EZradio Pro (Si4463)

embedded,real-time,radio,rt,efm
I cannot find the solution for my problem. If somebody has worked with Si4463 radio module? According to the datasheet, it must be simple, but I cannot make it work consistently. My transceiver sends data once each second. 1 byte preamble + 2 bytes sync + 7 bytes data +...

Are there General Purpose Boot Registers (GPBR) on a i.MX6 platform?

embedded
I've been using GPBRs on an Atmel AT91SAM9G45 platform for counting reboots within the bootloader. I would like to do the same on a i.MX6 platform based project, but I can't find any references to the existence of GPBRs in the reference manual. Is it true, that these don't exist?...

How to use APC220 Radio Communication Module in raspberry pi

linux,embedded,raspberry-pi,usbserial
I am developing a project using Arduino to send a message to Raspberry Pi using an APC220 Radio Communication Module. The Raspberry Pi can't receive serial message by using USB connect to APC220. I want to know how to use APC220 in Raspberry Pi?...

ASCII to int to ASCII (ATMEGA 2560)

c++,c,embedded,uart
I'm trying to make a embedded c project where i will input 7 chars and make some calculations with them - now i got problem getting my conversion to work - I'm working with a ATMEGA 2560, where I output the chars on uart. Here's the code: volatile char daata[8]...

CMSIS register values

arm,embedded,cpu-registers,cmsis
I have just started to explore the CMSIS for ARM controllers. It seems rather convenient to use it, however I was wondering where are the actual register values defined. Let's just take for example the GPIOs. There is a structure GPIOA_AHB_Type defined with various members. Then, for GPIOB, there is...

Casting pointers?

c,memory,embedded
What will happen If we cast 32 bit pointer to 8 bit? I assume that for example we have 0x8000 0000 and if we cast to 8 bit, the value of the new pointer will be 0x00. Am I right?...

Are there CSV files or lookup table to correct for real north now and in the future?

csv,gps,embedded,lookup,compass
I am currently working on placing a compass on an embedded microchip PIC32 family device I am working on. The compass is made in another part of the world and once assembled I want to be able to use it in other parts of the world without having to re-calibrate...

Low latency process on single core with embedded Linux

linux,embedded,low-latency,jack,cpuset
I would like to run a single low latency task (for audio, ALSA/JACK) on a separate core with an embedded Linux system. Removing scheduler and other interrupts might be the key here. There were several approaches I found so far, e.g. cpusets and an offline scheduler from 2009 (which unfortunately...

How to include freetype library to Keil uVision 4?

embedded,static-libraries,true-type-fonts,freetype,keil
I have to add freetype library to keil uvision 4 for dealing ttf font files. I followed the steps in http://www.freetype.org/freetype2/docs/tutorial/step1.html . I am trying to compile this code. example1.c I tried the tutorial in Ubuntu terminal with the help of C compiler error: Undefined reference to 'FT_Init_FreeType' . It...

Codevision AVR access external eeprom 24c02B using TWI

c,embedded,microcontroller,avr,eeprom
I'm a beginner in C. I'm trying to write and read to external eeprom (AT24c02B) then show the data bytes that store in eeprom to LED in PORTB and or to LCD. So I know the data successfully stored in eeprom. LED in PORTB is active low. Here is the...

Is it possible to program a “Java Card” - enabled smart card in any other language than Java?

c,embedded,smartcard,javacard
I have a Java Card enabled smart card and a card reader that was given by my Lab-instructor. I am supposed to do a project using Java Card 2.1.1 API. I don't like the Java Card API. Is it possible to program my given smart card using any other language...

Why Does `libusb_bulk_transfer' Return 0?

c,linux,embedded,libusb
I am using libusb-1.0. Sometimes when I call: int rc = libusb_bulk_transfer(handle_, EP_IN_ADDR, (unsigned char *)buf_, 64, &read_, 0); it returns rc = 0 (no error) and read_ = 0 (zero number of bytes received). But I have specified infinite timeout (last argument), so isn't `libusb_bulk_transfer' supposed to block until...

“Segmentation fault” when `rmmod` or `modprobe -r`

c,linux,kernel,embedded,kernel-module
Trying the simplest kernel module from LDD3 without any modification on custom built kernel v4.1.0-rc6 for Beagle Bone board with BusyBox v1.23.0. The code for the module is as follows: #include <linux/init.h> #include <linux/module.h> MODULE_LICENSE("Dual BSD/GPL"); static int hello_init(void) { printk(KERN_ALERT "Hello, world\n"); return 0; } static void hello_exit(void) {...

how to connect omap to oled display

embedded,linux-device-driver,embedded-linux,lcd
as you guys see the title , I would like to connect Micro OLED display to dart4460(omap4460). I am not sure but I guess I can use parallel LCD port in dart4460 to connect OLED display. here are what I want to connect displays. 1) http://1103zzeykfq2w1en1xnkh94yk.wpengine.netdna-cdn.com/wp-content/uploads/2013/07/SXGA-Datasheet-w-DF12-rev-13.pdf 2) http://www.olightek.com/products_detail/&productId=32.html : below...

Embedded systems: static or dynamic linking

c,embedded
For Embedded systems where the program runs independently on a micro-controller : Are the programs always static linked ? or in certain occasions it may be dynamic linked ?...

Restrict the size of built-in types

c,gcc,embedded
The company I work for used to produce and maintain small embedded systems based on a 68k processor. We'd like to move forward and stop maintaining those in favor of something like a Raspberry Pi, so I'm working on porting the inhouse library that was used to write software for...

STM32F4 Handling peripheral error while making a DMA Transfer (RX)

embedded,microcontroller,uart,dma,stm32f4discovery
I am trying to communicate with the UART peripheral using DMA for both RX and TX. I am using the HAL library that is supplied by ST (Generated with STCubeMX). I am handling a UART channel with 1.5MBaud - so in order to not loose any data, I've configured the...

using Diab, dcc 5.9.4 to compile a windows executable

embedded,cross-compiling,wind-river-workbench
I'm doing some experiments with an evaluation version of the WindRiver dcc diab compiler. I would like to do some testing on my Windows PC. However I think I have the wrong target setup. I've got as far as using the 'dctrl -t' command to get the list of target...

Pointer type of smaller size than variable

c,pointers,embedded
Working with embedded systems, in order to have more resolution in a incremental sequence, I have two variables, one always following the other. Specifically, I set a goal value using a 8 bits variable, but to go from one point (current value) to another I do it using 32 bits...

Call a function every 10 seconds in C - mbed platform

c,arm,embedded,microcontroller,mbed
I could use: while(1==1) { delay(10); f(); // <-- function to be called every 10 seconds otherfunctions(); } But this will take just over 10 seconds because the other functions take some time to execute. Is there a delay function that takes into account the time taken by the other...

how to use accelerometer sensor to detect and match two toy cars' collision

embedded,accelerometer
I am using Accelerometer Sensor to collect a toy car's acceleration data to tell whether it bumps into something or collide with another toy car. My idea is checking whether there is a sharp change of its acceleration data (for simplicity, just considering its x and y axis acceleration data...

STM32 STM32CubeF4 USB CDC operation

c,embedded,usb,stm32,cdc
I built the code from the STM32CubeF4 for the USB CDC example. I added the missing receive code for CDC_Receive_FS() in usbd_cdc_if.c. I loaded this into my STM32F4 Discovery and it works. A character typed on Tera Term returns and is displayed on Tera Term. I am hoping that someone...

Multiple variant types map in embedded

c++,class,dictionary,types,embedded
I am working on an embedded application so need something lean. I am using a map to store parameters. These will either be int or float data types. Where have I gone wrong with this? #include <string.h> class parameter_types { typedef int parameter_int; typedef float parameter_float; }; std::map<std::string, parameter_types*> mymap;...

Why does this code for incrementing an uint8_t include `& 0xFF`?

c,embedded,xilinx
When reading through some example codes for DMAs from Xilinx, I came across this piece of code: value = (value + 1) & 0xFF where value is an uint8_t. What is the point of the & 0xFF? Why not simply write value = value + 1?...

Detect when USB device was disconnected using usbd_core.c

c,embedded,usb
So working on an embedded system I have a USB drive that is used to charge the device as well as reading some data. Using usbd_core.c I can check the status, when there's nothing connected the status is 4 (USBD_STATE_SUSPENDED). As soon as I connect something the status changes to...

Prevent and catch access to secure memory from normal code

arm,embedded,bare-metal,trust-zone
I am exploring the ARM trustzone on my imx53-QSB and I have a question. I shared the memory between the normal and the secure world. But when I try to access to read from a secure memory adress from the normal (like that : cprintf("Secure Data SD0: 0x%x\n", *R32 SD0);)...

Embedded, Is it not possible to compile PIC controller using AVR/8051 compiler

c,embedded,8051,keil,gnu-toolchain
How can I compile a different micro-controller on different micro-controller family IDE/compiler. For example, I have 8051 keil uVision IDE. I need to compile the code for PIC or AVR controller. Is it possible, by changing any internal settings in the IDE? Or by adding Controller specific header files etc.?...

u-boot select boot partition based on GPIO state

embedded,embedded-linux,boot,gpio,u-boot
I'm developing a recovery mechanism on a embedded system. I want to boot into recovery mode if user pressed a GPIO button. Recovery mode means selecting different kernel and root partition than usual. I got stuck on using gpio value in conditional command. If I write if gpio input 20;...

Using all ports of MSP430 as one big port - is it possible?

embedded,msp430,memory-mapping
It will be more convenient for me to use all the MSP430 ports as one port. I was thinking maybe to overflow the registers until the next memory address, but it's not working (or maybe i'm not doing it right). To access BIT0 of PORT2, I tried Something like that:...

SAM4S initialization in baby steps

arm,embedded,microcontroller,atmel
This question may be so obvious it is stupid but I am failing to come up with an answer for it. I am trying to make a simple makefile project for the sam4s xplained board from Atmel. I am new to ARM and am feeling a bit lost in how...

UART over USB for STM32 Micro-controller

embedded,usb,stm32,uart,usbserial
I'm trying to implement UART over a USB interface on the STM324x9I-EVAL development board. The purpose is to send commands to a servo controller (or other hardware, for that matter) serially. I've successfully implemented the USB_Device_CDC example on the development board but am unsure exactly how this works without a...