Questions tagged [mbed]

1

votes
1

answer
851

Views

Using smart pointers on the mbed

Is there a way to use smart pointers on the mbed board, together with the mbed libraries? What compiler is needed?
Alex Brooks
1

votes
1

answer
598

Views

How to install mbed CLI on a Windows 10 system with Python 3.5?

I would like to install the ARM mbed CLI on my PC. I follow this tutorial from the official website: https://docs.mbed.com/docs/mbed-os-handbook/en/5.1/dev_tools/cli/ One of the prerequisites is having Python installed on the system. The tutorial mentions: Python - mbed CLI is a Python script, so yo...
K.Mulier
0

votes
0

answer
2

Views

STM32L0 Freeze on setting NVIC/GPIO

I'm working with an STM32L073RZ CPU running MbedOS 5.11.2. Eventually I aim to get this working in a very low-power mode (STOP mode) that will be awoken with either an RTC interrupt or an interrupt from a peripheral device on pin PA_0 (WAKEUP_PIN_1). At the moment I am simply attempting to setup PA_...
Adam Mitchell
1

votes
1

answer
1.2k

Views

What does the wait() function do?

Hi I started learning Java and am currently trying to learn C++. I have this piece of code and cannot workout what it does. I am assuming it makes the program wait for a certain period of time before it starts. But some further explanation would very useful. I have added comments to sections for whi...
user5647516
1

votes
3

answer
486

Views

How can i build locally mbed 2.0?

Hy, I can build mbedOS (mbed version of 3.0) with the yotta build system. Now I need a little help, to build mbed2.0 locally. I know there is an online compiler in the developer arm site, but i need to get some details about what is the difference between the two OS. Thanks.
Levente Orbán
1

votes
1

answer
109

Views

gcc4mbed compiler issue (c++)

I have a project that compiles just fine in the mbed online compiler, but when I try to compile it localy using gcc4mbed it fails with: MbedJSONValue.h:356:9: error: expected unqualified-id before '--' token int getc() { ^ MbedJSONValue.h:356:9: error: expected ')' before '--' token MbedJSONValue.cp...
wmmhihaa
1

votes
1

answer
959

Views

How to use available libraries from within mbed-os?

I have pulled down a fresh copy of mbed-os by using the mbed-cli tool. $ mbed new mbed-os-test [mbed] Creating new program 'mbed-os-test' (git) [mbed] Adding library 'mbed-os' from 'https://github.com/ARMmbed/mbed-os' at latest revision in the current branch [mbed] Updating reference 'mbed-os' -> 'h...
sherrellbc
1

votes
1

answer
514

Views

Undefined reference when using callbacks with ARM mbed [duplicate]

This question already has an answer here: Why can templates only be implemented in the header file? 15 answers Context: I am making a switch debouncing wrapper class for InterruptIn called Switch. Switch will allow a user to attach their own function which should be called-back when a real-world sw...
Yankee
1

votes
1

answer
478

Views

Correct Template constructor for MBED Callback of member function

I am using the mbed library and want to attach a member function to a Ticker (calls a callback function on regular interval) which is also a member. I may have multiples instances of my class and I would like each one to be able to manage its own Ticker and to allow the callback function to deal wi...
ptpaterson
1

votes
1

answer
352

Views

mbed-os compile - <new> library missing in arm-gcc

I am getting the following error message when i have mbed-os and my own library installed side by side folder layout: . |_mbed-os |_library /mbed-os/platform/Callback.h:21:15: fatal error: new: No such file or directory compilation terminated. which is originating form the following line: #include...
pfried
1

votes
1

answer
154

Views

How DAPLink make its virtual file system?

I am new to DAPLink. Just know that it could turn a cortex m0 chip into a mbed Interface, then we could program or debug thought it. But I found that the mbed Interface has about 8MB USB Disk. How does it work? As we known, a mbed Interface chip(such as 11u24) has only 8KB RAM and 64KB Flash.
JerryYip
-2

votes
1

answer
28

Views

Inside for loop: Convert text and int to const char* and pass to function

I'm trying to convert some text plus an int to const char* inside a 'for loop', and then pass this const char* to a function from a library (HTTPClient - mbed). (The function from the library only accepts const char* as parameters, and it simply adds the const char* values to an array, and later on...
Mads Gliemann
1

votes
1

answer
77

Views

mbed os 5 c++ programming

void rise_handler() { timer.start();} void fall_handler() { timer.stop(); } void signal() { while(1) { if (num > 0.5) { rise_handler(); } else { fall_handler(); } } } I have an input from the sensor and it changes with time. What should I do so when num is greater than 0.5 will only be called once...
Jiang Hui Ying
1

votes
2

answer
72

Views

Dispatch message properly UART

In my code, I have a serial interrupt that triggers when an event (receiving) occurs. In that, I'm saving the data to buffer and with that, sending the buffer to analyze. The problem I have is, how can I fetch the whole response from the serial port to buffer not just one char at the time? Serial pc...
Drejc
1

votes
3

answer
62

Views

Using value of enum within struct

I have the following class: class MyClass { public: enum myEnum { a = 0b0, b = 0b1, }; union myUnion { uint32_t all; struct myStruct { uint32_t start : 0b1; uint32_t enumValue : myEnum::a; } bits; }; ... }; I am simply unsure how to use the value of myEnum::a within the struct. I've tried a nu...
Adam Mitchell
1

votes
1

answer
85

Views

Writing a character to a file in C (mbed)?

This is my code C/C++ code for writing a character to a file. #include 'mbed.h' Serial pc(USBTX, USBRX); char c; char *cha = &c; int main() { FILE* WriteTo = fopen('/local/yourtext.txt', 'w'); pc.printf('Write something and then press enter when finished...\n\r'); while (c != '\n') { c = pc.getc();...
Lukali
0

votes
0

answer
3

Views

Adafruit Fona establishes connection with echo server, but doesn't send over any data

Using mbed OS and stm32 nucleo board with Adafruit Fona 3g, I am trying to send data to a server via 3g connection. I am using the .cpp file and .h file posted here: https://os.mbed.com/users/Nels885/code/Adafruit_FONA_3G/file/b18cfba4283a/ The code seems to get stuck on getTCPtimeout. I am having t...
User38t3
5

votes
1

answer
11k

Views

How to write/read to FLASH on STM32F4, Cortex M4

I want to write a variable, for example an integer with the number 5 to the FLASH and then after the power goes away and the device is turned on again read it. I already know that in order to write something I first need to erase the page and then write. In the manual it says: Write OPTKEY1 = 0x081...
Alex M.
2

votes
2

answer
91

Views

Passing peripheral objects to be used as class members in embedded systems

When doing embedded programming in C++ (say, with MBED), I very frequently have globally declared objects for device peripherals like I2C or Serial, which typically take parameters for the pins you're using for that device for your specific application: I2C i2c(SDA_1, SCL_1); Serial my_serial(D7, D...
Hierophect
1

votes
2

answer
461

Views

Converting 32-bit number to 16 bits or less

On my mbed LPC1768 I have an ADC on a pin which when polled returns a 16-bit short number normalised to a floating point value between 0-1. Document here. Because it converts it to a floating point number does that mean its 32-bits? Because the number I have is a number to six decimal places. Data T...
JamesDonnelly
3

votes
1

answer
2.2k

Views

ECDHE-PSK mbedTLS example?

I'm trying to figure out how to use mbedTLS (formerly PolarSSL) to perform ECDHE-PSK encryption between two peers. Unfortunately, there isn't any article/documentation whatsoever on APIs that I need to use?
tunafish24
2

votes
1

answer
333

Views

mbed TLS initialization

We have ported an app which was using OpenSSL to mbel TLS. The one issue with mbel TLS is the documentation which is far from complete and leaves details to assumption or exploration and risk of how things will change in future versions. While we already ported, we still not clear on which initiali...
yumoji
1

votes
2

answer
240

Views

Function local variable persists between function calls [duplicate]

This question already has an answer here: C local variable reused 3 answers I wrote a simple dot product function on an MBED LPC1768: float dotProduct(float a[], float b[], int length){ float sum; int i; for (i = 0; i < length; i++){ sum = sum + a[i]*b[i]; } return sum; } I have two calls to dotPro...
Kevin Chan
2

votes
1

answer
148

Views

Mbed: some basic questions

I am new in MbedOS. I am so confused about following questions. 1. What's the difference between yotta and CLI? 2. How do I port the MbedOS to my board? 3. What's the difference between Mbed 2.0 and 3.0? Thank you..
Mark
2

votes
1

answer
63

Views

Can't flash the module — 'Please insert disk'

I recently got a new Mbed board - this one is MTS Dragonfly. I can't get flash-disk to show up correctly, and I am wondering if I have got a DOA module, or I am doing something wrong. Does this happens to other Mbed boards? I have installed drivers from manufacturer website and do have a working ser...
Vladimir Akopyan
3

votes
2

answer
136

Views

How to slow the tempo down for different frequencies on a mbed device using C++

Hi I am trying to using different sound frequencies on an mbed application shield to create a tone from a song. Although I have gotten all the frequencies I cannot seem to slow the tempo down, as it just cycles through all of the frequencies really fast. I have tried to use the wait(); function but...
user5647516
3

votes
2

answer
295

Views

Hello World MQTT program in mbed

Was just testing a simple hello world mqtt program on my mbed board and I keep getting this error:   Error: Cannot open source input file 'fsl_enet.h': No such file or directory in 'EthernetInterface/lwip-eth/arch/TARGET_Freescale/k64f_emac_config.h', Line: 33, Col: 23. Error I even tried fixing th...
Xanzy
3

votes
1

answer
1.3k

Views

How does decryption work in mbedtls?

I wrote the following simple encryption-decryption program using mbedtls library. Encryption works fine (checked against http://aes.online-domain-tools.com/). However, when decrypting back I get incorrect result (output2 and input are different). Am I misusing the lib? int main() { mbedtls_aes_conte...
Sergey
3

votes
1

answer
841

Views

Path to GCC_ARM (mbed_settings.py)

I've just started to use mbed API, and every time I'm trying to compile my project this happen P.S. I'm on arch Linux usage: make.py [-h] [-m MCU] [-t TOOLCHAIN] [--color] [--cflags CFLAGS] [--asmflags ASMFLAGS] [--ldflags LDFLAGS] [-c] [--profile PROFILE] [--app-config APP_CONFIG] [-p PROGRAM] [-n...
MathieuAuclair
1

votes
1

answer
92

Views

Arm mbed online Compiler error 230 (or -230?)

I tried to compile some examples for the microbit with the arm-embed online compiler however no matter what I do I can't get anything compiled. Tried also an empty project, log-out and log-in again, close the browser and open the browser, switch off uBlock etc and still the same error. React on user...
Codebeat
2

votes
1

answer
74

Views

What files are linked in an mbed OS 5 project?

I'm writing an external library (a component controller) for use with mbed 5 and plan to make it available in the mbed repositories. I want to write tests to confirm that my code is working properly, but they're just regular ordinary unit tests and don't need to be run on an embedded controller. I'm...
chrylis
1

votes
1

answer
310

Views

how to let a function keep looping outside the main loop until a button is pressed

I have a function, which I want to keep running until a button is pressed (sw2_trig and sw3_trig), which makes it enter one of the modes in the main loop. The problem is that I tried a while loop and a do while loop outside the main loop to achieve this but it is not working, all it does is loop the...
user5647516
2

votes
1

answer
100

Views

mbed MemoryPool - is it usable for nontrivial classes?

I'm looking into using mbed's MemoryPool API, however it seems to be oriented for simple POD types. Inspecting the source of MemoryPool.h seems to show that it's just taking memory blocks and presenting as is (or zeroing the block if using calloc) and not doing placement new. I tried to follow th...
paulluap
0

votes
0

answer
17

Views

mbed combining two programs

I am trying to get my board connected to ethernet to do so I am using the code Nucleo_F746ZG_Ethernet this code uses an outdated version of mbed, but as soon as I update it it stops working. In my own made code I use the newest version of mbed that I need for a few functions. My question is, can I c...
Sam Hendriks
0

votes
0

answer
18

Views

Mbed Simple C Calculator

I have created a code to implement a keypad on an Mbed microcontroller. The code checks the entered pin versus the correct pin. Now, I need some help for converting this code into a simple calculator. I do not know how to convert the integer array into a string to return integer values. I want to b...
Dafrankster
4

votes
2

answer
2k

Views

Can't import com.android.future.usb.*

I'm following the steps to use ADK to control mbed via the Android Studio however their mbed adkport code (Scroll down to adkport hyperlink) requires these imports import com.android.future.usb.UsbAccessory; import com.android.future.usb.UsbManager; I've noticed another thread that suggested the dev...
Iancovici
1

votes
2

answer
266

Views

What happens on the background when mbed CLI flashes the chip?

Even though not every detail is relevant for this question, I will list my setup nonetheless: NUCLEO_F746ZG microcontroller board (https://os.mbed.com/platforms/ST-Nucleo-F746ZG/). I run mbed CLI (https://os.mbed.com/docs/v5.7/tools/arm-mbed-cli.html) to program the chip. My OS is Windows 10, 64-bit...
K.Mulier
2

votes
2

answer
98

Views

Configure VS Code for STM32 development on Windows 10

so I am pretty new to STM32 programming. As a part of my project I am using STM32L432KC board from ST. I used the Mbed online compiler to extract the blinky led example. I want to use VS Code, so I installed the C/C++ extensions and I also downloaded and installed GNU Arm Embedded toolchain. But now...
Matej
2

votes
0

answer
335

Views

CMake error while doing yotta build on Raspberry Pi

I am getting following error while I run 'yotta build' command. I am trying to install mbed client on Raspberry Pi. I am following this tutorial mbed client linux example Error: info: generate for target: x86-linux-native 1.0.0 at /home/pi/mbed-client-linux-example/yotta_targets/x86-linux-native --...
Ameya Chikodi
2

votes
1

answer
310

Views

Sending UDP packet upon interupt

I'm trying to send a UDP packet when an interrupt is triggered using the mbed platform. However, when i try to call udp_send from the interrupt function key_pressed, i get sys_arch_protect error. Could this be because some portion of UDPsocket is not being passed to the interrupt function? For the...
gr1121

View additional questions