This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Shutting down debug session

Hi,

I genareted a basic test project with stm32MXcube. I2C is active only. But i can not debug this project. After remap command (__HAL_AFIO_REMAP_I2C1_ENABLE();) shutting down debug session.

MCU: STM32F103VCT6
Debugger: ST-LINK/V2

I am using this wires:

1-PA14/SWCLK
2-PA13/SWDIO
3-NRST
4-VDD
5-VSS

PB9/SDA
PB8/SCL

If i don't use remap command ( PB7/SDA, PB6/SCL ) there is no any problem.

Please help me.

Thank you.

Parents
  • Did you check what is in "__HAL_AFIO_REMAP_I2C1_ENABLE"? Did you debugged this code?
    (as I know this are very buggy libraries)

    You have to do 2 things:
    1. Enable AFIO:

    RCC->APB2ENR |= RCC_APB2ENR_AFIOEN;
    

    2. Remap I2C1:

    AFIO->MAPR |= AFIO_MAPR_I2C1_REMAP;
    

    Check what this procesure changes more than this.

Reply
  • Did you check what is in "__HAL_AFIO_REMAP_I2C1_ENABLE"? Did you debugged this code?
    (as I know this are very buggy libraries)

    You have to do 2 things:
    1. Enable AFIO:

    RCC->APB2ENR |= RCC_APB2ENR_AFIOEN;
    

    2. Remap I2C1:

    AFIO->MAPR |= AFIO_MAPR_I2C1_REMAP;
    

    Check what this procesure changes more than this.

Children