plusk01 / airdamon_f3

Be the Matt Damon of the skies
2 stars 1 forks source link

VCP and MPU EXTI #6

Closed plusk01 closed 5 years ago

plusk01 commented 6 years ago

There seems to be a tight connection with the VCP being initialized and the MPU EXTI.... In beecore/examples/spi_mpu6500/main.cpp note the following comment:

  // for some reason, VCP needs to be initialized for MPU EXTI to work... (in RELEASE)
  VCP vcp;
  vcp.init();
plusk01 commented 5 years ago

Seems that the APB2 peripheral SYSCFG did not have its clock enabled. This peripheral manages EXTI for GPIO, which the IMU uses to signal it has a measurement.

Initializing the VCP was enabling the SYSCFG clock via Set_System(), which calls RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);.

The issue is fixed by adding the clock cmd to the relevant board.c.