Skip to main content
The 2024 Developer Survey results are live! See the results
5 votes
Accepted

Arduino Uno R3 assembly code to push a button and turn on a LED

This line: ldi r18, 0b00100000 ;pushed button does not match the definition of BUTTON. You are setting bit 5 of the register, whereas the button is on bit 3. In order to avoid this ...
Edgar Bonet's user avatar
  • 43.6k
5 votes

esp32, platformio A fatal error occurred: Packet content transfer stopped (received 8 bytes) *** [upload] Error 2

I was able to resolve this issue by detaching jumpers that i had connected to the GPIO 12/13 pins during upload. After uploading they can be attached again. See this github issue: https://github.com/...
Trizion's user avatar
  • 51
5 votes

esp32, platformio A fatal error occurred: Packet content transfer stopped (received 8 bytes) *** [upload] Error 2

I had this error when trying to upload a sketch from Arduino IDE to a TTGO T-Display, found that I could resolve this by changing the upload speed from the default of 921600 to 115200. After doing ...
steoleary's user avatar
  • 151
4 votes
Accepted

ESP32 partition table and writing location

0x1000 is the "second stage" bootloader. This is the code that is responsible for loading the code according to the layout specified in the partition table. In ESP-IDF, the binary image ...
Majenko's user avatar
  • 105k
4 votes
Accepted

PlatformIO and const PROGMEM

The PROGMEM qualifier can only be applied to statically-allocated constant data. When you move the decimalDigit array inside the class, it becomes a data member, i.e. you have one copy of the array ...
Edgar Bonet's user avatar
  • 43.6k
3 votes
Accepted

ATTiny85 pin definitions

The macros such as PB2 are defined in the avr-libc for accessing the bits of the raw I/O ports, with statements such as PORTB |= _BV(PB2); // set PB2 as HIGH They do not uniquely identify as pin: if ...
Edgar Bonet's user avatar
  • 43.6k
3 votes
Accepted

Enable full float-capable snprintf() library with PlatformIO

I finally found the answer at https://github.com/sstaub/LCDi2c When using PlatformIO, add the following line to platformio.ini to enable full support for floats to printf(): build_flags = -Wl,-u,...
Bitbang3r's user avatar
  • 551
3 votes
Accepted

Why is sensitivity (threshold) parameter ignored

Consider this subtraction: value - this->value Like in any arithmetic operation, the operands undergo integral promotion, then usual arithmetic conversions. Oversimplifying a bit, “integral ...
Edgar Bonet's user avatar
  • 43.6k
3 votes
Accepted

Splitting up code in multiple files causing `multiple definition` and `undefined reference` error

The failing is not with your code. The failing is with the MPU6050_6Axis_MotionApps20.h library. It erroneously has code in the header rather than in a separate CPP file. You have done everything ...
Majenko's user avatar
  • 105k
2 votes
Accepted

esp32, platformio A fatal error occurred: Packet content transfer stopped (received 8 bytes) *** [upload] Error 2

For anyone wondering, i found out it means that there's some kind of disconnect between the computer from which your uploading and the file system. Essentially, the esp32 is broken.
exo's user avatar
  • 57
2 votes

Help solving "collect2.exe: error: ld returned 1 exit status" error in code

I have figured it out. The problem was I had not properly set up the project with the proper libraries. I thought I was doing it right manually but I was not. PlatformIO has a really convenient ...
wileyrivers's user avatar
2 votes

Arduino code working via IDE, not via PlatformIO Arduino code

I had a similar behavior for a while and nothing I would change in the PlatformIO .ini configuration file seemed to help. I tried to re-init and clean the project, but also didn't seem to help. ...
Mohamed Elhariry's user avatar
2 votes

Best way to "hack" a library without forking it

Use a local source control and repository of your choice. Obtain the latest published rev of the library and make your changes to it (I assume you have already done this, probably a number of times). ...
JRobert's user avatar
  • 15.3k
2 votes
Accepted

How to do 'for' loop over inline anonymous array

I'm trying to enrich my C++ skills & be fancy The Arduino Mega is probably not the right platform to learn fancy C++. The development environment doesn't support all the modern C++ stuff. In ...
Edgar Bonet's user avatar
  • 43.6k
1 vote

Adding a custom platform to PlatformIO

Creating custom board support for PlatformIO PlatformIO provides a very comprehensive documentation on how to use PlatformIO for programming STM32 with various platforms. You can find "Custom ...
hcheung's user avatar
  • 1,451
1 vote

ESPAsyncDNSServer cannot find AsyncUDP anymore

for whatever reason, adding this to your platformio.ini env section helps: [env] lib_compat_mode = strict # default is "soft" I guess the more clean version would be to add this to your ...
slaesh's user avatar
  • 111
1 vote

PlatformIO and const PROGMEM

OK, I ended up blindly stumbling over the solution, even though at this moment I have no idea why it actually works. I moved the const PROGMEM uint8_t decimalDigit[10][8] = {...} declaration from ...
Bitbang3r's user avatar
  • 551
1 vote
Accepted

How to optimize checking for specific string in a UART stream

Here is an idea that may work: instead of buffering the input stream and comparing the buffer with the search string, you could do the comparison on the fly, as you receive the characters. Then you ...
Edgar Bonet's user avatar
  • 43.6k
1 vote

Arduino OTA - difference between Arduino IDE and PlatformIO

All I can see are three issues (plus possible some bonus ones) You can't daisy chain callback setters like that, it returns void and it doesn't make any sense to have void.onProgress... and those ...
KIIV's user avatar
  • 4,752
1 vote
Accepted

Simulate pin behaviour based on PulseView recording

I've never heard of such a test framework and I doubt there is one, at least for hobbyists. Such a framework would need to include a lot of hardware to accommodate all the possible electrical test ...
chrisl's user avatar
  • 16.4k
1 vote

How to do 'for' loop over inline anonymous array

Edgar Bonet answers why for (int pin : {DIP5, DIP4, DIP3, DIP2, DIP1, DIP0}) { isn't working. What you would get (where supported) with this syntax is an initializer_list which itself is not an array ...
timemage's user avatar
  • 5,334
1 vote

esp32, platformio A fatal error occurred: Packet content transfer stopped (received 8 bytes) *** [upload] Error 2

Hi all I found I got this error because my FTDI adapter was in 3.3V mode, not 5V as soon as I set it to 5V the issue was resolved and it programmed fine. One more thing to check before you scrap your ...
MR MICHAEL BRETT's user avatar
1 vote
Accepted

Create a library when using PlatformIO

You're describing "1.5.x" format libraries, not "PlatformIO". This arrangement for a library was created for Arduino IDE version 1.5.0. The critical part of this library format is ...
Majenko's user avatar
  • 105k
1 vote

Add library to CLion project

For what it's worth, I asked a similar question on StackOverflow, on the chance that the slightly different crowd might include someone who uses CLion + PlatformIO for non-Arduino embedded work and ...
Bitbang3r's user avatar
  • 551
1 vote

Unable to find headers from installed platformio library

I woke up this morning and looked back at the documentation. A part I mis-read was this: We recommend to use src folder for your C/C++ source files and include folder for your headers. You can also ...
Chris Schmitz's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible