I thought I'd mention at this late date that the current version of the ARMv7m Architecture Reference Manual does have Chapter 5 "The Thumb Instruction Set Encoding" that is helpful for decoding CM4 instructions. It's still pretty difficult, because essentially the instruction set is really ugly and not at all regular :-(
But for your F1AD0D08 (...
I assumed I could just reprogram my MAX32660 by holding it in reset, such as one does with AVRs for example.
yeah, no. What the reset pin means and what a programming mode is depends on what the manufacturer designs it to be!
Since modern ARM MCUs tend to be much, much nicer than AVRs ever where, many of them have a boot pin with which you can select a ...
The flash is not directly programmed via SWD.
First a piece of MCU code, a loader stub that can program FLASH, is loaded via SWD to SRAM.
Then the data that needs to be programmed is transferred to SRAM via SWD.
Finally the CPU is told to jump and execute the programming code and it does the programming.
This way you can program to any internal or external ...
I was able to get PyOCD up and running in 15 minutes, and it successfully programs the MAX32660 from a Linux environment, which was my goal. It required the max32660 pack to be installed, then it just worked... had the DAP driver enabled by default, apparently.
Wow, this setup is so FAST, in terms of compile/program cycle. I will never use Eclipse again. ...
As cortex m0+ doesn't have some of the fancy 32bit or even 16bit intermediate
and as you will compile to even 1K boundary, You just have to point to new vector table by 8bit left shifted.
if ( firm1 > firm2) __asm("movs r0, #0x40"); // firmware at 0x4000
else __asm("movs r0, #0xa0"); // for firmware at ...
To make a long story short, your immediate problem is in this line:
If you are trying to invoke this function then you need to call it from inside another function. Typically that would be inside your main function. If, on the other hand, you are trying to provide a forward-declaration of the function then you have a syntax error (the function ...
I prefer creating an empty project using STM32CubeIDE or TrueStudio, then adding CMSIS and ST headers manually. This way, you can enjoy using predefined register and bit names and also some CMSIS functions while avoiding the burden of Cube platform (or any other library).
You can get CMSIS files from their official github page.
For headers, you need to ...
Im going to bring you down to pretty bare baremetal, and then you can complicate this from there, but should have a much higher chance of success.
This code blinks the led on port pin PC13.
This uses gnu tools, as written you can use pretty much any gcc for arm from say gcc 3.x.x or gcc 4.x.x to the present gcc 9.x.x. Can use the linux variants or the non-...
It is inconsistent. However the recommendation from ARM may be copied directly, as it does not assume that there would be internal pull-up on the SWDIO pin, but ST put an internal pull-up.
More than often it reads that the internal pull resistors on JTAG/SWD port eliminates the need for external resistors.
If all you have to do in C is give the function a specific name, then your project is using weak binding to select the interrupt handler. In this case, all you need to do is create an assembly function with the correct symbol name. With EABI, this should be the same as the C function name. Otherwise, you may need to add an underscore to the front of the name ...
How do I change the address at the above entry to point to the start address of my assembly code so that I can handle the interrupt in assembly?
Asssuming default startup, just declare the function with the correct name in assembler:
Note: This ...
So, I thought, maybe, just an idea, those locations will contain the memory address(pointer) to the interrupt handler functions.
That's how it works. There is also VTOR, as Marcus described. However, simple projects use something called a startup assembler file, usually startup.s where the stack, heap and vector table are put at their position.
The vector ...
That address is program flash. If you want to write to flash, it is possible, you need to first erase it by using the flash peripheral, and you can't really erase the program you are executing, so don't do that. There is two ways to do this correctly. You can copy the vector table to SRAM and tell the NVIC to point the vector table in SRAM, so you can freely ...
Possibly, the vector table is relocated; there's a register that stores the "0" address of that table, and that can be adjusted. That's actually a pretty handy feature: it allows you to set up a interrupt handler table anywhere in RAM, and then with one write to VTOR (which is at address 0x08, I think), you can switch over to that new table.
You need to have a look at the processor's memory configuration. The Cortex-M4 implements the ARMv7-M architecture. Here's a grab of the top half of the memory map (annoyingly this is split over two pages in the M4's reference manual).
As you can see, the area 0x00000000 - 0x1FFFFFFF is allocated to Code. The STM implementation will not include an ...
Your understanding of software breakpoints is basically correct: the code is modified, i.e. a breakpoint instruction is inserted in place of the real instruction and the real instruction is saved somewhere else. The specific technique depends on the debugger, CPU and operating system.
Few debuggers are capable of applying software breakpoints in MCUs with ...