2017年5月11日 星期四

nrf52 : Add CMSIS_DSP package in Keil 5

1.Open Manage Run-Time Environment and check the DSP














2.Include arm_math.h
  and  path in your project:Keil_v5\ARM\PACK\ARM\CMSIS\5.0.1\CMSIS\Include

3.Add symbol ARM_MATH_CM4 since nrf52832 use Cortex M4F






4.Simple matrix multiplication code

const q31_t A[9] =
{
3, 3, 3,
3, 3, 3,
3, 3, 3
};
const q31_t X[9] =
{
1, 0, 0,
0, 1, 0,
0, 0, 1,
};
const q31_t Y[9] =
{
0, 0, 0,
0, 0, 0,
0, 0, 0,
};
int main(void)
{
arm_matrix_instance_q31 A_F;
arm_matrix_instance_q31 X_F;
arm_matrix_instance_q31 Y_F;
arm_status status;
uint32_t srcRows = 3,srcColumns = 3;
arm_mat_init_q31(&A_F, srcRows, srcColumns, (q31_t *)A);
arm_mat_init_q31(&X_F, srcRows, srcColumns, (q31_t *)X);
arm_mat_init_q31(&Y_F, srcRows, srcColumns, (q31_t *)Y);
status = arm_mat_mult_q31(&A_F, &X_F, &Y_F);
while(status != ARM_MATH_SUCCESS);
}
view raw gistfile1.txt hosted with ❤ by GitHub
Ref:
    1. CMSIS DSP Software Library







沒有留言:

張貼留言

Linux driver: How to enable dynamic debug at booting time for built-in driver.

 Dynamic debug is useful for debug driver, and can be enable by: 1. Mount debug fs #>mount -t debugfs none /sys/kernel/debug 2. Enable dy...