Quantcast
Browsing all 46 articles
Browse latest View live

Answer by Jeremy for Extract read-only data sections from an archive/lib (ELF...

Rather than extract data from the compiled binary, why not extract it from the generated C code, compress it, and generate equivalent C code with the compressed data?This approach would probably...

View Article


Answer by Jeremy for How to use member type of a template class without...

I am trying to use a member type of a template class, which does not depend on any template parameters of the template class.As a nested type within class A<T>, MemberTypedoes depend on the...

View Article


Answer by Jeremy for Is there a way to prevent an added .o file section of...

In principle the KEEP command in your command file should do this.From the GNU ld manual:3.6.4.4 Input Section and Garbage CollectionWhen link-time garbage collection is in use (‘--gc-sections’), it is...

View Article

Answer by Jeremy for How does objcopy compute what sections for the elf file...

The 'A' flag in the Flg column of the readelf output, which ELF calls SHF_ALLOC, indicates a section that 'occupies memory during process execution'.SHF_ALLOC : The section occupies memory during...

View Article

Answer by Jeremy for If make_shared/make_unique can throw bad_alloc, why is...

Throwing bad_alloc has two effects:It allows the error to be caught and handled somewhere in the caller hierarchy.It produces well-defined behaviour, regardless of whether or not such handling...

View Article


Answer by Jeremy for ARM C++ compiler won't compile structure with volatile...

I don't have access to the Keil compiler, but under g++ 7.4.0, this struct generates an error not where it is defined, but where an instance of it is instantiated.i.e. The line VAR_Type fred;results in...

View Article

Answer by Jeremy for Reading output pin level on SAMDG55

Referring to Figure 16-2 in the SAMG55 data sheet, and to sections 16.5.4 and 16.5.8:16.5.4 Output Control... The level driven on an I/O line can be determined by writing in the Set Output Data...

View Article

Answer by Jeremy for C++ efficient way to remove first x elements, push the...

vector::erase() doesn't reallocate, it only moves contents within the already-allocated capacity and adjusts the size. (Note that erase() doesn't throw bad_alloc, only copy/move/assignment exceptions....

View Article


Shared receive buffer for USB endpoints?

I'm developing a USB device driver for a microcontroller (Atmel/Microchip SAMD21, but I think the question is a general one). I need multiple endpoints for control & data, and the USB hardware uses...

View Article


Answer by Jeremy for Pin configurator and database for bare metal embedded...

Arduino uses a simple system that works - at a very rudimentary level - somewhat along the lines you describe for Topic 1, albeit entirely at runtime (and it imposes no requirement that pin assignments...

View Article

Answer by Jeremy for Why enable the interrupt so early on threadx scheduler...

The short answer is that it's safe because beyond that point the system can handle an interrupt without leaving its critical data structures in an inconsistent state.More specifically, after that point...

View Article

Answer by Jeremy for How I can make alias on external defined function in C?

As suggested here, add the following to your linker command file:PROVIDE(NMI_Handler = Default_Handler);(And remove the weak alias declaration from the C code.)

View Article

Answer 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


Answer 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 Article

Answer 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 Article


GCC, 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 Article

Answer 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 Article


Why 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 Article

Answer 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 Article

Answer 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 Article
Browsing all 46 articles
Browse latest View live