migrating SPI driver to MQX

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

migrating SPI driver to MQX

ソリューションへジャンプ
1,171件の閲覧回数
JULIOOSVALDOANG
Contributor I

Hi there

I´m migrating an (working) SPI driver to MQX.

I had to install the SPI interruption something like this:

_int_install_isr(0x2b, (INT_ISR_FPTR)SPIB_ISR, NULL);

the interruption takes place (vector 0x2b) in my own

ISR I'm  accessing to SPI register. I can see that the registers

actually get the correct value but the SPI data never goes out,

I mean I can get the MOSI  data signals with an oscilloscope. So

I'm stock rigth now

Could someone suggest me how to proceed?

thanks in advance

--> Julio

タグ(3)
0 件の賞賛
1 解決策
570件の閲覧回数
RadekS
NXP Employee
NXP Employee

In case of interrupt, you have two options how to install it:

1. MQX managed isr

_int_install_isr(vector, isr_ptr, isr_data);

_bsp_int_init(vector, priority, subpriority, enable);

2. Kernel isr to interrupt MQX

_int_install_kernel_isr(Vector, isr_ptr); /* works only for vector table located in the RAM */

_bsp_int_init(vector, priority, subpriority, enable);

When vector table is in flash, you can install your kernel isr into the hw vector table in vectors.c in BSP project. MQX doesn’t know about this interrupt therefore you cannot call MQX API from this interrupt.

Since you want use driver which is independent on MQX, I guess that Kernel isr is option what you are looking for. Anyway, you have to use also _bsp_int_init() function for enabling this interrupt.

There could be some also issues due to concurrence with MQX SPI driver. Please look at BSP code and check MQX SPI driver initialization. BSPCFG_ENABLE_SPIx in user_config.h should be zero otherwise MQX SPI driver will be initialized in _bsp_init() function.

I hope it helps you.


Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
2 返答(返信)
571件の閲覧回数
RadekS
NXP Employee
NXP Employee

In case of interrupt, you have two options how to install it:

1. MQX managed isr

_int_install_isr(vector, isr_ptr, isr_data);

_bsp_int_init(vector, priority, subpriority, enable);

2. Kernel isr to interrupt MQX

_int_install_kernel_isr(Vector, isr_ptr); /* works only for vector table located in the RAM */

_bsp_int_init(vector, priority, subpriority, enable);

When vector table is in flash, you can install your kernel isr into the hw vector table in vectors.c in BSP project. MQX doesn’t know about this interrupt therefore you cannot call MQX API from this interrupt.

Since you want use driver which is independent on MQX, I guess that Kernel isr is option what you are looking for. Anyway, you have to use also _bsp_int_init() function for enabling this interrupt.

There could be some also issues due to concurrence with MQX SPI driver. Please look at BSP code and check MQX SPI driver initialization. BSPCFG_ENABLE_SPIx in user_config.h should be zero otherwise MQX SPI driver will be initialized in _bsp_init() function.

I hope it helps you.


Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
570件の閲覧回数
JULIOOSVALDOANG
Contributor I

thanks  a lot RadekS

the actual fix were enable BSPCFG_ENABLE_SPI1 in user_config.h (I´m using SPI1)

and now is working. I installed the interrupt  with the MQX ISR manager

_int_install_isr(vector, isr_ptr, isr_data);

_bsp_int_init(vector, priority, subpriority, enable);

0 件の賞賛