QN9090-PINT not being triggered

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

QN9090-PINT not being triggered

ソリューションへジャンプ
3,914件の閲覧回数
blas_m
Contributor III

Hello there,

I am trying to add a PINT interrupt into a NXP BLE Stack example design using the #QN9090

I have taken the PINT example code from the drivers and placed it at the main_task() function in the "ApplMain.c" file. The pin used in the QN9090 is the PIO15(also tested with PIO7 and PIO4 from the expansion board).

The Interrupt is defined in the PIN via HW Config tools like:

blas_m_2-1686061745798.png

The initialization code looks like:

blas_m_0-1686061476517.png

 

The set-up code to trigger the interrupt contains only 2 commands(aside from the print-out):

blas_m_1-1686061588208.png

"pint_intr_callback" function prints-out a message every time the interrupt is called. However this message never gets called or the interrupt never gets listed when I read the Pint interrupts with the command :
PINT_PinInterruptGetStatusAll(PINT)

It looks like the Interrupt has not been set-up correctly or the Pin Interrupts are not enabled
What could I do to make it work?

0 件の賞賛
返信
1 解決策
3,680件の閲覧回数
blas_m
Contributor III

Hi Eduardo,

Problem solved.
Following your suggestions to add an additional switch functionality on the code, it allowed me to realize how the PINT are being used in the NXP BLE example design.
The file 'board.c' configures the switch pins on the Devkit and assigns them with an Interrupt and a physical PIN. Then I saw the PINT_0 & PINT_1 Interrupts were already being used.

On the top of that the different functions associated to configure the 'dk6_button_io_pins[]' also call other functions to clear-out the associated Interrupts registers which caused the problem that even though my code was assign the PIN_0 to my pin, this interrupt could be cleared out by another callback function.

Solution:
Assign to my own PINT any interrupt not being used by the devkit switches: PINT_2 or PINT_3 
Alternatively, Devkit switches can be disabled by commenting out : KBD_Init(App_KeyboardCallBack); on main_task()

blas_m_0-1687340099794.png

 

元の投稿で解決策を見る

7 返答(返信)
3,761件の閲覧回数
blas_m
Contributor III

Hi Eduardo,

The Communication protocol will be UART.
Yes, the PINT is going to be used as "handshake" signal for the QN9090 to know that a transmission will start at the UART port.
While the PINT is enabled or the data being send via UART to the QN9090, there is no BLE link/connection so the QN9090 will be either advertising in Slow Mode or not Advertising at all

I have a QN9090 DK6 (V3) devkit with the expansion board OM15082. This expansion board contains 4-leds and 4-buttons. I would like to get any NXP BLE example design working with a PINT on the button SW3 (this button is connected to PIO_7). The interrupt code should NOT be part of  the BLE App code. As additional info, my base NXP design is the private_profile_server working as Peripheral node

Let me know if you need any more info, thanks for your help and interest
Cheers
Blas

0 件の賞賛
返信
3,739件の閲覧回数
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

Please, try the following:

  • In source/app_preinclude.h file, set gKBD_KeysCount_c to 3 and, if implemented, disable (set to 0) low-power features (UsePowerDownMode and FullPowerDownMode)

EduardoZamora_0-1686761228819.png

EduardoZamora_1-1686761228820.png

  • In board/gpio_pins.h, define Port0 Pin7 as BUTTON3

EduardoZamora_2-1686761228820.png

  • In source/main.c (for example private_profile_server.c), in BleApp_HandleKeys() function (which handles keyboard events), add the event corresponding to PB3, gKBD_EventPB3_c:

EduardoZamora_4-1686761744699.png

Regards,
Eduardo.

3,681件の閲覧回数
blas_m
Contributor III

Hi Eduardo,

Problem solved.
Following your suggestions to add an additional switch functionality on the code, it allowed me to realize how the PINT are being used in the NXP BLE example design.
The file 'board.c' configures the switch pins on the Devkit and assigns them with an Interrupt and a physical PIN. Then I saw the PINT_0 & PINT_1 Interrupts were already being used.

On the top of that the different functions associated to configure the 'dk6_button_io_pins[]' also call other functions to clear-out the associated Interrupts registers which caused the problem that even though my code was assign the PIN_0 to my pin, this interrupt could be cleared out by another callback function.

Solution:
Assign to my own PINT any interrupt not being used by the devkit switches: PINT_2 or PINT_3 
Alternatively, Devkit switches can be disabled by commenting out : KBD_Init(App_KeyboardCallBack); on main_task()

blas_m_0-1687340099794.png

 

3,718件の閲覧回数
blas_m
Contributor III

Hi Eduardo, that works on the 'private_profile_server' example and our design!! Kudos to you.
Let me check how such implementation works with PINTs before mark it as a Solution
Thanks for the idea!!

0 件の賞賛
返信
3,854件の閲覧回数
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @blas_m

Hope you are doing well.

Just to confirm, are you planning to use the PINT as a wake-up source for BLE?

Regards,
Eduardo.

0 件の賞賛
返信
3,791件の閲覧回数
blas_m
Contributor III

Hi Eduardo,

Thank you for enquiring about this.
The PINT is NOT going to be used as a wake-up pin for the QN9090 BLE sleep mode. 
The pin in question is going to be used as a means to let the QN9090 to know there is some data available on one of its Communication ports. Basically, the QN9090 is a Slave device and a Master device toggles/enables this pin to force the QN9090 to read from certain port

I did some debugging on the registers via MCUXpresso. I can see the PINTSEL[0] for the PINT0 interrupt pointing to the PIO selected for the purpose, PIO_4 or PIO_7. See image
PINT0_using_PIO_7.PNG
Then PINT registers are cleared and enabled for an active LOW interrupt on this pin. With the callback function listed:
PINT0_enabled_LOW.PNG

So a few things I would like to find out are:
- How do I know there is a clock associated for the PINT to be triggered?
- How could I find out the NVIC interrupt for the PINT0 is enabled?

Regards
Blas

 

0 件の賞賛
返信
3,773件の閲覧回数
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

Could you please help us with more details about your application? What is the communication protocol that you are planning to use?

Just to clarify, are you trying to use this PINT, for example, as a "handshake" to indicate that a significant data transmission is about to start? Please consider that BLE applications have some time constrains that must be considered to avoid interrupting the stack process or destroying the connections.

Regards,
Eduardo.

0 件の賞賛
返信