embedded

Embedded C++ - polymorphism and inheritance

房东的猫 提交于 2019-12-24 09:48:12
问题 I'm writing a game (space invaders) on an Arduino which is connected to a graphical LCD, and I have a sprite class. This class has attributes such as Player/Alien, a bitmap object, location(x,y), and a how to move function. I want each instance to have a missile and I think this may be done by inheritance and polymorphism, though I'm unsure how -- my streamlined code is below and to give a better idea as to shapes I've included a glyph image. I'd like Missile to derive location(x,y) from the

Interact with a STM32 chip's memory in C [closed]

拈花ヽ惹草 提交于 2019-12-24 08:55:50
问题 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 2 years ago . I would like to interact with a STM32 chip's memory , STM32L476, first to read and store its electronic signature (MCU_ID) and then to write data in its memory . I am using a STM32QFP64 socket linked to a JTAG ST-LINK. I am quite good in C but really beginning embedded programming so I chose Atollic Studio IDE

GCC Inline Assembly to IAR Inline Assembly

纵然是瞬间 提交于 2019-12-24 07:46:37
问题 I am attempting to use BeRTOS for a Texas Instruments Stellaris Cortex-M3. My work environment is IAR. There were a lot of minor changes to accommodate IAR and the specific uC that I am using but I've got one that I can't seem to solve... and frankly it's a bit over my head. This bit of code: 1 void NAKED lm3s_busyWait(unsigned long iterations) 2 { 3 register uint32_t __n __asm("r0") = iterations; 4 5 __asm volatile ( 6 "1: subs r0, #1\n\t" 7 "bne 1b\n\t" 8 "bx lr\n\t" 9 : : "r"(__n) :

Access NOR memory from userspace

强颜欢笑 提交于 2019-12-24 07:17:34
问题 On my Compulab cm-x270 CoM Linux kernel placed in NOR. This kernel without MTD support, and after boot I can't access to NOR as MTD partition. My goal is update this kernel from userspace. Yes, update from bootloader by tftp most easier way, but I can't use it in this task. It is possible mapping NOR in /dev/mem or any another way? 回答1: I had a similar situation with SRAM. I wrote a block device driver for /dev/sram . Access through a device driver preserves all of the Linux security rules.

How to erase just some bytes of Flash Memory?

a 夏天 提交于 2019-12-24 05:42:06
问题 My PIC18F87J11 only erases 1024 bytes at a time. Is there away to force it to only erase 2 bytes or more at a time? I am making a Bootloader and sometimes only one line of the HEX file (16 bytes) changes for the application program, so I want to replace that line in memory with the new 16 bytes only . If I try to erase those 16 bytes, automatically 1024 bytes get erased too. Then I am forced to re-write them which takes some time and reduce the speed of the Bootloader. Is there an alternative

How can you check whether your kernel supports GPIO on your hardware?

拜拜、爱过 提交于 2019-12-24 05:19:28
问题 My aim is to control the GPIO pins in Peppermint 4 Linux (Kernel version 3.8.0) on an Intel motherboard (NM70 chipset with C1037U processor). How can you check whether your kernel supports GPIO on your hardware? Background Motherboard: Intel with NM70 chipset Processor: C1037U processor OS: Peppermint 4 Linux Kernel version: 3.8.0 GPIO interface: sysfs I'm attempting to use the sysfs interface, which allows GPIO pins to be accessed from userspace through the filesystem. I’ve successfully

What can be the least possible value of data-compression-ratio for any real dataset

ぃ、小莉子 提交于 2019-12-24 05:18:04
问题 I am writing ZLIB like API for an embedded hardware compressor which uses deflate algorithm for compression of given input stream. Before going further i would like to explain data compression ratio. Data compression ratio is defined as the ratio between the uncompressed size and compressed size. Compression ratio is usually greater than one. which mean compressed data is usually smaller than uncompressed data, which is whole point to do compression. but this is not always the case. for

Using pointer functions - 2 separate applications on 1 device

懵懂的女人 提交于 2019-12-24 02:33:28
问题 I asked some time ago this question How can I use one function from main application and bootloader? (embedded) and started to implement proposed solution but ran into a few problems. On my cortex M4 I, have 2 separate applications - bootloader and user application. Now I had some (many) functions which were the same for both apps. So I compiled them only for bootloader, then created an array of function pointers at specified address, which is known for user application. So in application, I

Writing a device driver for Platform Bus in Embedded Systems?

送分小仙女□ 提交于 2019-12-24 02:09:28
问题 I have gone through some driver implementation in Linux Kernel Source and can see that these are the platform driver. drivers/net/ethernet/smsc/smsc911x.c static struct platform_driver smc911x_driver = { .probe = smc911x_drv_probe, .remove = smc911x_drv_remove, .suspend = smc911x_drv_suspend, .resume = smc911x_drv_resume, .driver = { .name = CARDNAME, .owner = THIS_MODULE, }, }; Above is a driver for platform device(smsc based Ethernet controller) and platform devices are devices which are

Writing a device driver for Platform Bus in Embedded Systems?

こ雲淡風輕ζ 提交于 2019-12-24 02:08:56
问题 I have gone through some driver implementation in Linux Kernel Source and can see that these are the platform driver. drivers/net/ethernet/smsc/smsc911x.c static struct platform_driver smc911x_driver = { .probe = smc911x_drv_probe, .remove = smc911x_drv_remove, .suspend = smc911x_drv_suspend, .resume = smc911x_drv_resume, .driver = { .name = CARDNAME, .owner = THIS_MODULE, }, }; Above is a driver for platform device(smsc based Ethernet controller) and platform devices are devices which are