diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-12-14 07:51:19 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-12-14 07:51:19 +0100 |
commit | c2aae4ccb63158f197c3d0629082e7699dfe8e25 (patch) | |
tree | 647d7de9bf61552bfc89b0a736f68caada92611c /test1.cpp | |
parent | afbb4cc73c44b6321cae39dbe46b97155805097d (diff) | |
download | stm32f103-playground-c2aae4ccb63158f197c3d0629082e7699dfe8e25.tar.gz stm32f103-playground-c2aae4ccb63158f197c3d0629082e7699dfe8e25.tar.bz2 stm32f103-playground-c2aae4ccb63158f197c3d0629082e7699dfe8e25.tar.xz stm32f103-playground-c2aae4ccb63158f197c3d0629082e7699dfe8e25.zip |
correct linking, putting the assembly code in .text with proper linking script made ld recognise the functions as thumb instructions.
Diffstat (limited to 'test1.cpp')
-rw-r--r-- | test1.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -18,6 +18,7 @@ extern "C" void high(); extern "C" void low(); SCB_Type *__SCB = ((SCB_Type *) SCB_BASE); +//extern SCB_Type *__SCB; struct hardfault_data_t { uint32_t r0; @@ -54,10 +55,11 @@ void HardFault_Handler_C(uint32_t * hardfault_args) { */ int main() { -// SystemInit(); + SystemInit(); + SCB->SHCSR |= SCB_SHCSR_USGFAULTENA_Msk | SCB_SHCSR_MEMFAULTPENDED_Msk | SCB_SHCSR_BUSFAULTENA_Msk; -// RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); -// RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOA, ENABLE); + RCC_APB2PeriphClockCmd(RCC_APB2Periph_AFIO, ENABLE); + RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOA, ENABLE); // GPIO_InitTypeDef init; // GPIO_StructInit(&init); |