cortex-m3

How do I debug unexpected resets in a STM32 device?

时光毁灭记忆、已成空白 提交于 2020-01-30 14:40:08
问题 I'm doing some development in C with a STM32F107 chip and, at some point, the device began to reset when I call a specific function. I don't have a debugger and my debugging is just plain text over a serial port. I've used some other microcontrollers in which I was able to access a register to see the cause of the reset, but I can't seem to find an equivalent for this device. I'm aware of the hardware exceptions of the Cortex-M3, but I don't know if one of them is being triggered since I can

Writing data to absolute address

╄→尐↘猪︶ㄣ 提交于 2020-01-24 17:17:05
问题 I'm currently playing around a bit with assembler on a Cortex-M3 microcontroller. I'm not sure if this is important, but here you go. I need to write a value into to a certain address in memory. Here is what I tried: LDR R4, =__cs3_interrupt_vector_cortex_m STR R4, [=VTOR] But it seems like I need to reference the VTOR address relative to the PC register. The question is if there is a way to not reference the address relativ and let this do automatically (so that it would basically look like

Output debug via printf on a Cortex-M3 CPU, stalls at BKPT instruction + confusion about JTAG and sw ports

∥☆過路亽.° 提交于 2020-01-21 05:16:30
问题 I have a Keil ULINK2 USB emulator box attached to the JTAG connector on my board, which is working fine with the Cortex-M3 CPU onboard (TI/Stellaris/LuminaryMicro LM3S series). It seems that both a JTAG and a SWJ-DP port share the same pins (and thus connector on your board) on these CPUs. One appears not to have ITM (printf) capability, the other does. The previous firmware people have always used stdio to UART (serial port), but I need the serial port freed up so that debug messages do not

How to retain a stacktrace when Cortex-M3 gone in hardfault?

泄露秘密 提交于 2020-01-03 13:34:41
问题 Using the following setup: Cortex-M3 based µC gcc-arm cross toolchain using C and C++ FreeRtos 7.5.3 Eclipse Luna Segger Jlink with JLinkGDBServer Code Confidence FreeRtos debug plugin Using JLinkGDBServer and eclipse as debug frontend, I always have a nice stacktrace when stepping through my code. When using the Code Confidence freertos tools (eclipse plugin), I also see the stacktraces of all threads which are currently not running (without that plugin, I see just the stacktrace of the

ARM M4 Instructions per Cycle (IPC) counters

為{幸葍}努か 提交于 2019-12-31 13:32:05
问题 I would like to count the number of Instructions per Cycle executed on an ARM cortex-M4 (or cortex-M3) processor. What it's needed is: number of instructions (executed at runtime) of the code I want to profile and number of cycles that the code takes to execute. 1 - Number of Cycles Use the cycle counter is quite easy and straightforward. volatile unsigned int *DWT_CYCCNT ; volatile unsigned int *DWT_CONTROL ; volatile unsigned int *SCB_DEMCR ; void reset_timer(){ DWT_CYCCNT = (int *

ARM M4 Instructions per Cycle (IPC) counters

筅森魡賤 提交于 2019-12-31 13:30:10
问题 I would like to count the number of Instructions per Cycle executed on an ARM cortex-M4 (or cortex-M3) processor. What it's needed is: number of instructions (executed at runtime) of the code I want to profile and number of cycles that the code takes to execute. 1 - Number of Cycles Use the cycle counter is quite easy and straightforward. volatile unsigned int *DWT_CYCCNT ; volatile unsigned int *DWT_CONTROL ; volatile unsigned int *SCB_DEMCR ; void reset_timer(){ DWT_CYCCNT = (int *

Safely detect, if function is called from an ISR?

感情迁移 提交于 2019-12-30 16:25:09
问题 I'm developing software for an ARM Cortex M3 (NXP LPC1769) microncontroller. At the moment I'm searching for a mechansim to detect if my function is called within an ISR. I asume that I have to check a register. Based on this information I would like to call difficult functions. I already checked the reference manual, if there is a register containing the necessary information. For example I tried to detect if I'm called from an ISR (I used SysTick-ISR) based on the "Interrupt Active Bit

Eclipse GDB “init” and “run” settings for ARM LPC1768 using OpenOCD?

旧街凉风 提交于 2019-12-30 10:06:20
问题 I finally figured out how to get code running on this LPC1768 mini board, however now I'm trying to get debugging working. The toolchain I'm using is: Yagarto + Eclipse (Indigo) (w/ GDB Hardware Debugger) + OpenOCD . My JTAG interface is: Bus Blaster V2 board. I found one guide that walks through a similar setup, but it's for a different JTAG interface so not very useful. There's also this post regarding an LPC1768 example, but the gdb commands aren't for OpenOCD. At this point the only

Zeroconf Name resolution

杀马特。学长 韩版系。学妹 提交于 2019-12-21 11:04:18
问题 I am developing a control device with an embedded webserver. The webserver provides a control interface to any web browser that requests it (from Windows browsers, Mac browsers, iPhone android etc). The problem I am having is with a general way of generically knowing how to access the device. i.e. what address to type in the web browser. Fixed IPs are too techie for my users and could go wrong as my device could be plugged into many different Local networks. Using uPnp service discovery

Add a custom compiler to XCode 3.2

限于喜欢 提交于 2019-12-21 04:31:28
问题 I have a working gcc 4.3.3 toolchain for an ARM Cortex-m3 and would like to integrate it into XCode. Is there a way to set up XCode (3.2) to use this gcc toolchain instead of the built-in GCC 4.2? What I've tried so far: I've added a modified copy of the GCC 4.2.xcplugin and changed the name, version and executable path. It shows up in XCode but whenever I set the "C/C++ Compiler Version" to the custom compiler it fails with Invalid value '4.3.3' for GCC_VERSION It seems like the valid