embedded

Linker file vector table for bootloader setup

北战南征 提交于 2019-12-08 04:43:21
问题 I am currently trying to use a bootloader application created using MCUXPresso that requires that my application start address is located at 0x80000. According to the following documentation: However, the .bin I generate is created with Kinetis Design Studio (an earlier version of MCUXpresso) and does not have the option to modify the vector table in such an easy way as in MCUXPresso. What I've been trying is modifying the linker file manually doing the following: ENTRY(Reset_Handler) /*

What is the sequence to be followed to play a song using gstreramer?

别来无恙 提交于 2019-12-08 04:23:59
问题 I am building a music player based on gstreamer-0.10. I am able to play the successfully , but I have issues when I change the state of the pipeline. I have posted the code to initialize and start the pipeline below : void start_gstreamer() { gst_init(0,NULL);//call to initialise gstreamer time_val=0;//set to default value volume = 1.0;//set volume to default value player = gst_element_factory_make ("playbin2", "player");//get pipeline equalizer = gst_element_factory_make ("equalizer-10bands"

Count seconds and minutes with MCU timer/interrupt?

天大地大妈咪最大 提交于 2019-12-08 04:23:53
问题 I am trying to figure out how to create a timer for my C8051F020 MCU. The following code uses the value passed to init_Timer2() with the following formula: 65535-(0.1 / (12/2000000)=48868. I set up the timer to count every time it executes and for every 10 counts, count one second. This is based on the above formula. 48868 when passed to init_Timer2 will produce a 0.1 second delay. It would take ten of them per second. However, when I test the timer it is a little fast. At ten seconds the

Modbus implementation in C for embedded system lpcxpresso

五迷三道 提交于 2019-12-08 03:43:24
问题 I am new to modbus and I have to program a lpcxpresso baseboard as a master to collect readings from a powermeter using RS485 Modbus protocol. I am familiar with the protocol (about the PDU ADU frame, function codes, master-slave) through reading of specifications from modbus.org. However I have difficulties in the implementation when writing the code in C. So my questions are: Do I have to open connection, set the baud rate, etc when I am starting the connection? I am thinking to send the

Looking for Example Embedded Linux HID Device Code

蓝咒 提交于 2019-12-08 03:41:51
问题 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

Assembly code for creating interrupts vector on LPC2148 ARM processor

寵の児 提交于 2019-12-08 02:16:50
问题 I have just recently started to work with LPC2148 ARM processor. I am trying to understand some assembly code regarding the creation of the interrupts vector. here is the code: // Runtime Interrupt Vectors // ------------------------- Vectors: b _start // reset - _start ldr pc,_undf // undefined - _undf ldr pc,_swi // SWI - _swi ldr pc,_pabt // program abort - _pabt ldr pc,_dabt // data abort - _dabt nop // reserved ldr pc,[pc,#-0xFF0] // IRQ - read the VIC ldr pc,_fiq // FIQ - _fiq #if 0 //

Difference between map file and linker file

若如初见. 提交于 2019-12-07 22:19:00
问题 What is the difference between the map file generated by the linker and the linker file that contains the memory segments itself ? 回答1: the 'linker' file is a set of commands to the linker as to how everything is to be laid out in memory and is created by the programmer. The 'map' file is a listing of where everything is located in memory and is created by the linker. 来源: https://stackoverflow.com/questions/48614377/difference-between-map-file-and-linker-file

What is “Super Loop” in Embedded C programming language?

五迷三道 提交于 2019-12-07 21:49:06
问题 What is Super Loop in Embedded C programming language? 回答1: This refers to the eternal loop usually located in main() of a "bare metal" system (no OS), since such systems can never return from main. A typical bare metal embedded system looks like this: void main (void) { // various initializations for(;;) // "super loop" or "main loop" { // do stuff } } 回答2: MCU is device which runs continuously or better, it executes instructions when power is on (in general). So while loop is here to force

Is that possible to make a callback interface with only function-member attribute?

為{幸葍}努か 提交于 2019-12-07 19:49:23
问题 Context: Embedded c++ with no heap use. I want to master my code (its size included), so I would prefer not to use standard lib such as std::function. 1st Approach: Let's take this example (which is a simplified version of my code) using a modified version of the CRTP: Note: the method of my callback could have theses 2 signatures: bool (ChildCrtp::*)(void); and void (ChildCrtp::*)(int) (one for action, one for condition). #include <iostream> #include <stdint.h> using namespace std; void*

Reading from 16-bit hardware registers

眉间皱痕 提交于 2019-12-07 18:58:22
问题 On an embedded system we have a setup that allows us to read arbitrary data over a command-line interface for diagnostic purposes. For most data, this works fine, we use memcpy() to copy data at the requested address and send it back across a serial connection. However, for 16-bit hardware registers, memcpy() causes some problems. If I try to access a 16-bit hardware register using two 8-bit accesses, the high-order byte doesn't read correctly. Has anyone encountered this issue? I'm a 'high