Answer by Jeremy for How to calculate expected core file size
I use the following script, seems to work quite well. As the comment explains, we simply find the largest LOAD section end offset in the file. (Note that it accounts for sparse files.)If I remember...
View ArticleAnswer by Jeremy for How to verify GameKit LocalPlayer auth signature on...
Since you're calculating the payload hash yourself, you need to tell public_key.verify() this by specifying utils.Prehashed(hashes.SHA256()) instead of just hashes.SHA256() (where utils is...
View ArticleIs Google Test auto-registration vulnerable to the static initialisation...
Using Google Test with c++11, if tests are defined across separate compilation units, is the auto-registration mechanism vulnerable to the static initialisation order fiasco?If not, why not?EDITED TO...
View ArticleComment by Jeremy on How does BX LR work on an exception return in cortex-M...
Note that 'eret' requires that it is known that the function is an exception handler, whereas 'bx lr' and the other 2 are the standard function return instructions. Likewise the M's' automatic register...
View ArticleComment by Jeremy on What is the best/correct way to handle shared memory...
Instead of relying on the linker(s) to position your structures for each processor, have only one of the processors do this (its linker might do it, or it could do it at runtime init) and have it...
View ArticleAnswer by Jeremy for Raspberry Pi Pico UART: How to receive (and process)...
See RP2040 manual section Section 4.2.6.4. 'UARTRTINT', which describes the receive timeout interrupt. I believe the timeout is fixed at 32 bit times.As @sawdust's comment indicates, the ISR for this...
View ArticleComment by Jeremy on SAM3x8e I2C slave holds SDA low following transmission...
Could this be somehow related to clock stretching? More specifically, the master not correctly reacting to the slave's attempt to do clock stretching? I once had weird problems a bit like this using...
View ArticleComment by Jeremy on MCU SysTick infinite loop
You're not following the initialisation order described in developer.arm.com/documentation/dui0662/b/… . Perhaps you've finally hit a low-probability condition that this sequence avoids?
View ArticleAnswer by Jeremy for Embedding constant at specific memory location
Assuming the bootloader and main app are both under your control, you could have the bootloader jump to the application entry point with a pointer to the version information (and any other information...
View ArticleVSCode won't run batch file any more
I've been using VSCode on Windows for some years to debug Cortex-M microcontroller systems, using the cortex-debug extension and Arm's builds of the gcc development tools (including...
View ArticleComment by Jeremy on When to use std::expected instead of exceptions
So in fact what you're suggesting is to adopt 2 strategies from the outset.
View ArticleComment by Jeremy on usb protocol: my device is not see any next packet after...
A rather delayed comment, I'm afraid - but I seem to remember from my own attempts at this type of work (on a different device) that I had to save the assigned address and only write it to the hardware...
View ArticleAnswer by Jeremy for **PICO PI** UART: How to receive (and process) chunks of...
See RP2040 manual section Section 4.2.6.4. 'UARTRTINT', which describes the receive timeout interrupt. I believe the timeout is fixed at 32 bit times.As @sawdust's comment indicates, the ISR for this...
View ArticleAnswer by Jeremy for Why do I need std::get_temporary_buffer?
Microsoft's standard library guy says the following (here):Could you perhaps explain when to use 'get_temporary_buffer'It has a very specialized purpose. Note that it doesn't throwexceptions, like new...
View ArticleWhy does boost::filesystem::canonical() require the target path to exist?
The documentation for boost::filesystem::canonical(const path& p) states:Overview: Converts p, which must exist, to an absolute path that has no symbolic link, dot, or dot-dot elements....Remarks:...
View ArticleAnswer by Jeremy for Selectively suppressing glibc link warnings?
First of all, it's important to remember that the warnings are (usually) there for a reason. If you can find a way to avoid linking the symbols that the warning refers to, that's a far preferable...
View ArticleGCC, GDB, and is_stmt
I'm using GNU Arm Embedded Toolchain 10.3 to cross-compile for a Cortex-M0+ target, and using the accompanying GDB to debug.I want to set a breakpoint on the following line of code: if...
View ArticleAnswer by Jeremy for Cannot find header files when cross compiling with clang...
I've found that -sysroot doesn't solve the problem on my system and so - as suggested by the relevant Clang documentation - I've explicitly specified include paths using -isystem:ifeq...
View ArticleAnswer by Jeremy for How to use Raspberry Pi Pico with DAC with SPI to...
Aside from any other issues, the SPI hardware implementation in the RP2040 only provides automatic control of CSn for transfers of up to 16 bits.For your case, implementing a simple, 24-bit...
View ArticleAnswer by Jeremy for Cortex-M0+ not responding to PendSV
It turns out that the problem is caused by single-stepping the instruction that writes to the PENDSVSET bit in the ICSR: the bit is set, and the VECTPENDING field shows 0xe, but the PendSV never...
View Article