Quantcast
Channel: User Jeremy - Stack Overflow
Browsing latest articles
Browse All 41 View Live

Comment by Jeremy on Cortex-M0+ not responding to PendSV

@cooperised - I suspect you might be right. According to the reference manual, stepping can occur with or without interrupts disabled. I'm pretty sure I've successfully stepped through identical code...

View Article



Comment by Jeremy on How to program the bootloader area with JLink in an ARM...

Have you asked on the Segger forum? In my experience their engineers are responsive, and Segger releases software and firmware updates (including Beta versions) pretty regularly....

View Article

Comment by Jeremy on Segger RTT control block is not identified by RTT viewer

I've found that using RTT (via Segger SysView) while JLinkGdbServer is running works very intermittently (<10%) - but if I quit GdbServer (leaving the target running) then SysView works perfectly....

View Article

Comment by Jeremy on Overeager struct packing warnings with...

This question is quite old, but I had a similar problem with GCC 10.3. Despite the warning indicating [-Wattributes], I found that it was controlled by the -Wpacked option: "Warn if a structure is...

View Article

Comment by Jeremy on Atmel SAMD21 DMAC writeback failure?

@gOnZo - Kind of. I stopped using that device.

View Article


Comment by Jeremy on Clang-15 vs Clang-14 local static init guards

You're right, I cheated on the source code. Updated with the real example. The generated code is, however, verbatim.

View Article

Comment by Jeremy on Clang-15 vs Clang-14 local static init guards

I guess it's more an academic question - although one important practical difference is that the second case actually requires an implementation of __atomic_load_1 to be provided from somewhere (e.g....

View Article

Comment by Jeremy on Clearing or preventing pending interrupts in an ISR

In addition to disabling the external interrupt, you also need to clear the interrupt condition that invoked the isr in the first place (by writing to INTFLAG).

View Article


Comment by Jeremy on How to avoid clang-format from formatting the curly...

BreakBeforeBraces: Custom (with BraceWrapping.*) doesn't give you sufficient control?

View Article


Comment by Jeremy on Atmel SAMD21 DMA Abort issue

Possibly the same issue as stackoverflow.com/questions/62833342/…

View Article

Comment by Jeremy on Where does GDB store its general register layout?

Your question is really "where does GDB document its general register layout, right? GDB's own handling of this is found in github.com/bminor/binutils-gdb/blob/master/gdb/arm-tdep.c

View Article

Comment by Jeremy on Calculate Symbol-Size From Linker-Map-File

Your analysis seems reasonable - I suspect amap is not doing its calculations correctly.

View Article

Comment by Jeremy on Where to find documentation on earlier version of GDB?

This question isn't asking for a recommendation. It's asking for the location of a specific version of a specific document. Bizarre to close it.

View Article


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

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 Article


Answer by Jeremy for HDLC - Purpose of PF bit in Asynchronous Balanced Mode...

As described in section 5.4.3.1.3 of ISO13239:In ARM and ABM, the P bit set to "1" shall be used to solicit a response, at the earliest respond opportunity, with the F bit set to"1".NOTE : For example,...

View Article

Answer by Jeremy for Writing uint32 to uint64 is not atomic. Why?

As Peter Cordes points out, the atomic instructions would be required for the per-thread increments. The reason is given in the text, but the superfluous 'however' clouds it slightly:That said, atomic...

View Article


Answer by Jeremy for How to test Bit-Banged communication's assembly routines

I thought about toggling a "debug pin" to indicate when the sampling is actually happening, but this introduces delays in the sampling procedure, hence I wouldn't be testing my original routine.Test...

View Article

Answer by Jeremy for How to implement preemptive scheduling using HAL in...

If you're seeing tail chaining rather than preemption, then it's possible that NVIC priority grouping isn't configured as you expect - and thus configuring the two interrupts into priority groups 0 and...

View Article

Answer by Jeremy for Encoding Log Message to improve storage space on...

One quite effective approach to handling log string literals in a C/C++ environment is to allocate them to a distinct linker section, which is stripped from the final binary.The log statements are...

View Article

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

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

Browsing latest articles
Browse All 41 View Live




Latest Images