20 votes
Accepted

What instruction on the STM32 consumes the least amount of power?

If you want power-saving, put the MCU to sleep. The relevant instructions are WFI and WFE: wait-for-interrupt and wait-for-event, respectively. WFI is kind of self-explanatory: it wakes up when you ...
Aleksi Torhamo's user avatar
15 votes

Best pattern for WFI (wait-for-interrupt) on Cortex (ARM) microcontrolers

Put it inside a critical section. ISRs won't run, so you don't run the risk of dont_sleep changing before WFI, but they will still wake the processor and the ISRs will execute as soon as the critical ...
Kenzi's user avatar
  • 251
15 votes
Accepted

Bare-metal start-up code for Cortex M3 .bss region initialization

As you suspect, this is happening because the unsigned int data type is 4 bytes in size. Each *bss_start_p = 0; statement actually clears four bytes of the bss area....
bitsmack's user avatar
  • 16.9k
15 votes

What is DMIPS/MHz?

Dhrystone is a standardized speed test with a specific workload mix. Different CPU architectures have different strengths and weaknesses. For example, a 75 MHz SPARC easily beats a 400 MHz PentiumII ...
Simon Richter's user avatar
10 votes

What is DMIPS/MHz?

Dhrystone is the name of a standardised a very old benchmark software, it gives as result the measured number of MIPS, where MIPS is Million Instructions Per Second. The figure was adjusted from long ...
Grabul's user avatar
  • 3,472
6 votes

What instruction on the STM32 consumes the least amount of power?

Lets try to answer the opposite question to explain why NOP doesn't save power. The Cortex-M3 is a processor designed to be small and relatively simple - it doesn't ...
Sean Houlihane's user avatar
6 votes
Accepted

Is a STM32F103 able to handle 74.25MHz from an image sensor?

No, it simply is not capable in any way. The F103 MCU has a maximum frequency of 72 MHz so it cannot do anything past that, and it has no DCMI camera interface to assist in receiving parallel video ...
Justme's user avatar
  • 149k
5 votes

Bare-metal start-up code for Cortex M3 .bss region initialization

There are countless other sites and examples. Many thousands if not tens of thousands. There are the well known c libraries with linker scripts and boostrap code, newlib, glibc in particular but ...
old_timer's user avatar
  • 8,273
4 votes

GUI library for HMI Cortex M

Open-source Embedded GUI Library https://littlevgl.com LittlevGL is a free and open-source graphics library providing everything you need to create embedded GUI with easy-to-use graphical elements, ...
seyyah's user avatar
  • 41
4 votes

What instruction on the STM32 consumes the least amount of power?

If you're happy for samples every 62.5ms or 31.25ms (as opposed to 50ms), you can use the RTC alarm function to wake up the STM32 and standby/stop between conversions. This will massively save power, ...
Pyrohaz's user avatar
  • 316
4 votes

Understanding ARM instruction for numerical literal

Updated As pointed out by @ChrisStratton in comments, the answer below ignored the fact that the processor in use does not support the 4-byte ARM instruction set, and only runs "Thumb" code. Based ...
Jules's user avatar
  • 2,046
4 votes

Bare-metal start-up code for Cortex M3 .bss region initialization

Just change != to <. That's usually a better approach anyway, as it deals with problems like this.
Elliot Alderson's user avatar
4 votes

Bare-metal start-up code for Cortex M3 .bss region initialization

The standard solution is memset(): #include <string.h> memset(&_BSS_START, 0, &_BSS_END - &_BSS_START) If ...
ilkkachu's user avatar
  • 1,067
3 votes

Load and store CPU registers in application context

I am not sure if you are aware the logic already stores the state of the machine during an event/interrupt. If you want to use this to task switch you need to remove/re-build the stack to account for ...
old_timer's user avatar
  • 8,273
3 votes
Accepted

Programming SRAM over SWD

If you have a linker script which links your executable to an appropriate address for ram, then you could interpret the hex file and extract the payload bytes. But it would probably be easier to use ...
Chris Stratton's user avatar
3 votes
Accepted

STM32 Standard Peripheral Library (SPL) - Modify SPI Configuration

If you find the SPI_CR1 register in the Reference Manual, you can see that the speed is set by the BR bits (bits 5:3 in SPI_CR1). You can adjust the baud rate on the fly by changing these bits, as ...
bitsmack's user avatar
  • 16.9k
3 votes

What instruction on the STM32 consumes the least amount of power?

I'd look into using a timer to start the conversion, and an interrupt to collect the result. The CPU core can then sleep until data is available.
Simon Richter's user avatar
3 votes

LPC1769 PC Communication

As far as the chip is concerned, you can use any UART port for any purpose you like. However, if you are using a particular evaluation board or a particular software library, these may impose ...
Dave Tweed's user avatar
  • 173k
3 votes
Accepted

LPC1788 external interrupt with CMSIS

There are no newer versions of these functions, because neither older ones ever existed! To clarify myself these are not CMSIS functions. Downloading the official package from NXP, in either version ...
Fotis Panagiotopoulos's user avatar
3 votes

Understanding ARM instruction for numerical literal

Without the original opcodes, it's not possible to say with full confidence if this sequence is being accurately decoded. However, one possibility which would be legitimate on a Cortex M3 would be ...
Chris Stratton's user avatar
2 votes

Best pattern for WFI (wait-for-interrupt) on Cortex (ARM) microcontrolers

Assuming that: The main thread runs background tasks The interrupts only run high priority tasks and no background tasks The main thread can be interrupted any time (it does not normally masks ...
hdante's user avatar
  • 121
2 votes
Accepted

How to read/write from a CPU using a usbWiggler?

The Cortex M3 will almost always be implemented with a CoreSight DAP providing the eternal debug port. Simplistically, you use the JTAG to set control registers in the DAP, and the DAP performs memory ...
Sean Houlihane's user avatar
2 votes
Accepted

Finding maximum source impedance for A/D converter (SAM3X8E ARM Cortex-M3)

There are charts on pages 1408 and 1409 of that datasheet which give ADC max. source impedances vs ADC frequencies. According to that chart, the 'worst case' acceptable source impedance is 353Kohm ...
Robherc KV5ROB's user avatar
2 votes

Programming SRAM over SWD

I can certainly appreciate the roll your own first principles thing, and applaud that. But, I also recommend walking before you run. Just because you want to do it all yourself doesnt mean you cant ...
old_timer's user avatar
  • 8,273
2 votes

Load and store CPU registers in application context

in the SysTick_Handler another LED is toggled with SysTick-frequency, which also stops toggling after the first PendSV call. I know that they have the same priority If ...
followed Monica to Codidact's user avatar
2 votes

Mysterious hard-fault when I step over

Some ideas which might help when debugging a hard fault on a cortex m4, maybe some of them are useful: - the line which causes the hard fault is put on stack at address +0x18, if the interrupt is ...
Marius E.'s user avatar
2 votes
Accepted

Can the ARM processor be switched to unprivileged mode inside handler mode?

So can I switch back to unprivileged here? Yes. The simplest method would be to set up another stack for the unprivileged "thread". Now you can simply switch stacks in the interrupt handler and use ...
Turbo J's user avatar
  • 10.1k
2 votes

Unable to get SPI working on STM32 Cortex-M3 (Blue Pill)

Following Chris Stratton's advice, I found a working example which I was able to follow in combination with Arduino Uno and then adjusted it to get it working for the HopeRF95W. There's however ...
Sam Hammamy's user avatar
2 votes

J-Link programmer in Windows 8 don't work

I found the way to fix it do this steps: 1- uninstall windows jlink driver like this: 2- uninstall jlink segger software, like this: 3-install another segger jlink software linke this version. 4- ...
Soheil Paper's user avatar

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