embedded

Volatile member variables vs. volatile object?

亡梦爱人 提交于 2020-05-14 03:52:22
问题 I'm trying to implement a multiple producer (via interrupt), single consumer (via application thread) queue on an embedded target in "MpscQueue.h" below. I'm wondering if I can safely remove the some of the volatile usage below (see inline questions). I would also consider using volatile std::array in place of the C-style buffer_[] shown below, but I was unsure if I could trust its implementation to match the intent of the below. A third alternative would be to mark the MpscQueue object

Volatile member variables vs. volatile object?

拟墨画扇 提交于 2020-05-14 03:51:27
问题 I'm trying to implement a multiple producer (via interrupt), single consumer (via application thread) queue on an embedded target in "MpscQueue.h" below. I'm wondering if I can safely remove the some of the volatile usage below (see inline questions). I would also consider using volatile std::array in place of the C-style buffer_[] shown below, but I was unsure if I could trust its implementation to match the intent of the below. A third alternative would be to mark the MpscQueue object

Light the LED on STM32F103C8T6

懵懂的女人 提交于 2020-04-29 15:42:50
问题 I'm trying the light an LED (on port c, pin 13) on STM32F103C8T6. I'm not using IDE. Code: #include "include/stm32f10x.h" int main() { RCC->APB2ENR |= RCC_APB2ENR_IOPCEN; GPIOC->CRH &= ~GPIO_CRH_CNF13; GPIOC->CRH |= GPIO_CRH_MODE13_0; GPIOC->BSRR = GPIO_BSRR_BR13; while(1) { GPIOC->BSRR = GPIO_BSRR_BS13; } return 0; } Links to include files in include directory: system_stm32f10x.h core_cmInstr.h core_cmFunc.h core_cm3.h stm32f10x.h part1 stm32f10x.h part2 That's how I compile it arm-none-eabi

Derby使用3—Embedded模式

对着背影说爱祢 提交于 2020-04-16 11:32:10
【推荐阅读】微服务还能火多久?>>> 零、回顾 这部分先来回顾一下上两篇博客中的主要内容。第一篇博客中主要简单介绍了Derby数据的历史,特点,安装以及使用的两种模式。第二篇文章主要介绍了客户机-服务器(C/S)模式的使用。今天继续介绍第二种使用模式,内嵌模式(Embedded Mode)。 一、客户端使用内嵌模式 与之前介绍的C/S模式不同,使用内嵌模式时不需要开启一个数据库的服务进程来监听并处理客户端的请求,客户端可以自行的完成这些命令。所以使用内嵌模式是有一定优势的。 下面来具体介绍这种模式的使用。首先还是要设置好CLASSPATH的环境变量。同样有两种方法,即使用Derby数据库编译好的脚本文件。可以执行命令: setEmbeddedCP 将所需要的jar文件配置在CLASSPATH环境变量中。或者自己手动加入,执行命令: export CLASSPATH=$DERBY_HOME/lib/derbytools.jar:$DERBY_HOME\lib\derby.jar: 我们还是需要运行ij工具,运行方式可以参照上一篇博客。之后还是执行连接数据库的命令: jdbc:derby:DB_Path/DB_NAME;create=true' 这里需要多说一句,就是查找数据路径的根目录位置,如果没有设置derby.system.home(即数据库主目录的位置)

Issues reading data from ADXL355 using SPI (STM32 board)

老子叫甜甜 提交于 2020-04-16 03:33:51
问题 I'm trying to read data from an EVAL-ADXL355-PMDZ connected to a STM2L072 Lora discovery kit through the SPI protocol for a project. At first I was using an ADXL345 sensor and I was able to read the accelerometric data and convert it to g without any issues. After switching the sensor to ADXL355, I keep receive all zeroes when reading data registers instead. I changed my initial code for ADXL345 accordingly to the datasheet of the ADXL355 sensor (https://www.analog.com/media/en/technical

Issues reading data from ADXL355 using SPI (STM32 board)

半城伤御伤魂 提交于 2020-04-16 03:33:46
问题 I'm trying to read data from an EVAL-ADXL355-PMDZ connected to a STM2L072 Lora discovery kit through the SPI protocol for a project. At first I was using an ADXL345 sensor and I was able to read the accelerometric data and convert it to g without any issues. After switching the sensor to ADXL355, I keep receive all zeroes when reading data registers instead. I changed my initial code for ADXL345 accordingly to the datasheet of the ADXL355 sensor (https://www.analog.com/media/en/technical

How to Cast Integer Value to Pointer Address Without Triggering Warnings

女生的网名这么多〃 提交于 2020-04-13 03:47:11
问题 I have the following variable uint32_t Value = 0x80 0x80 represents an address in the memory e.g. // Write 2 at address 0x80 *(uint32_t*)((uint32_t)0x80) = 2; How can i cast Value to a Pointer, so it points to 0x80? uint32_t *Pointer = ?? Value; This: (uint32_t*)(uint32_t)Value; returns: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 回答1: To handle integer to object pointer conversion, use the optional integer uintptr_t or intptr_t types. Function pointers are

Writing and Compiling Program For OpenWrt

末鹿安然 提交于 2020-04-11 07:34:31
问题 I have a embedded device with MIPS arch working under OpenWRT system type: MediaTek MT7628AN ver:1 eco:2 machine: WRTnode2P processor: 0 cpu model: MIPS 24KEc V5.5 I want to compile compile a small program in C through my computer (ubuntu) #include <stdio.h> int main(void){ printf("HelloWorld"); return 0; } To compile it I use mips-linux-gnu-gcc command mips-linux-gnu-gcc -march=24kec -mabi=32 hello.c -o hello I send hello program to my device and make a chmod 755 chmod 755 hello When I try

[教程]使用buildroot完全自定义自己的embedded linux系统(nand)

烂漫一生 提交于 2020-04-10 22:25:19
ubuntu, fedora, debian太过庞大了,你是否想完完全全的构建自己的embedded linux系统?本篇文章教你如何实现 编译环境: ubuntu 12.04(x86_64) 目标环境: 1) linux-3.4内核 2) buildroot 2013-02 3)系统运行在nand上 固件制作步骤说明: 步骤一:创建自己的工作目录 $mkdir ~/mylinux $cd ~/mylinux 步骤二:获取源代码 $git clone git://github.com/cubieboard/sunxi-tools.git tools $git clone git://github.com/cubieboard/u-boot-sunxi.git u-boot $git clone git://github.com/cubieboard/buildroot-sunxi.git buildroot $git clone git://github.com/cubieboard/linux-sunxi.git linux-3.4 步骤三:切换到sunxi-3.4-cb分支 $cd tools $git checkout -b sunxi-3.4-cb origin/sunxi-3.4-cb $cd - $cd u-boot $git checkout -b sunxi-3.4

Calibrating and configuring evdevtouch on embedded qt project

一个人想着一个人 提交于 2020-03-05 05:38:46
问题 I have a Qt project running on a icoremx6solo with linux. I've setted up the graphics and run the code, but i can't handle touch inputs. Enabling the input logging with export QT_LOGGING_RULES="qt.qpa.input=true" i discovered that the coordinates ar not setted, i think that this is the main problem with that: qt.qpa.input: evdevtouch: /dev/input/event0: Protocol type B (multi) qt.qpa.input: evdevtouch: /dev/input/event0: min X: 0 max X: -1 qt.qpa.input: evdevtouch: /dev/input/event0: min Y: 0