Hi, I am trying to take two matrices and multiply them. I am using CMSIS library source and .h files which compiled and uploaded correctly.
The vector addition function works correctly. However, when I tried to multiply one vector and one matrix stm32 stops working. I tried to debug the code and find out when the program comes to arm_mat_mult_f32(...) it bricks and waits at "startup_stm32f4xx.S" line Default_Handler:Infinite_Loop: b Infinite_Loop
and doesn't proceed to next step.
Has anyone encountered this problem? or used library functions?
Below you can see my code:
#include "stm32f4xx.h"
#include "stm32f4_discovery.h"
#include "DSPLib/arm_math.h"
float32_t Vector1[] = {1,2,3};
float32_t Vector2[] = {1,2,3};
float32_t ResultVec[3];
void Initialization(){
RCC->AHB1ENR |= RCC_AHB1ENR_GPIODEN;
GPIOD->MODER = (GPIOD->MODER | GPIO_MODER_MODER15_0) & ~(GPIO_MODER_MODER15_1);
GPIOD->OTYPER &= ~(GPIO_OTYPER_OT_15);
GPIOD->OSPEEDR |= GPIO_OSPEEDER_OSPEEDR15;
GPIOD->PUPDR &= ~(GPIO_PUPDR_PUPDR15);
}
int main(void)
{
Initialization();
arm_matrix_instance_f32 V1;
arm_matrix_instance_f32 V2;
arm_matrix_instance_f32 RV;
arm_mat_init_f32(&V1,3,1,(float32_t *)Vector1);
arm_mat_init_f32(&V2,1,3,(float32_t *)Vector2);
arm_mat_init_f32(&RV,3,3,ResultVec);
arm_mat_mult_f32(&V1,&V2,&RV);
while(1)
{
if(ResultVec[0] == 1)
{
GPIOD->BSRRL |= GPIO_BSRR_BS_15;
}
}
}