Can I call MQX services from PEx events (ISRs)?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I call MQX services from PEx events (ISRs)?

Jump to solution
830 Views
anguel
Contributor V

Hi!

I see that MQX includes Processor Expert BSPs. But I wonder if I am really allowed to call MQX services like lwevents from PEx events (ISRs).

Thank you for any feedback,

Anguel

0 Kudos
1 Solution
593 Views
petr_uhlir
NXP Employee
NXP Employee

Yes you can. PEx events are callbacks from PEx interrupts which are installed by RTOS adapter as standard MQX interrupts.

View solution in original post

0 Kudos
8 Replies
594 Views
petr_uhlir
NXP Employee
NXP Employee

Yes you can. PEx events are callbacks from PEx interrupts which are installed by RTOS adapter as standard MQX interrupts.

0 Kudos
593 Views
anguel
Contributor V

Petr,

Thank you for the answer! In the meantime I also found out that this should work without problems.

Do you have any information why there is no pe_demo project for the Kwikstik board? I would like to test some things with this board and PEx and MQX and I see there is a .pe file in the BSP. Should I simply create a new MQX project or how should I get started?

Regards,

Anguel

0 Kudos
593 Views
petr_uhlir
NXP Employee
NXP Employee

Anguel,

the problem of pe_demo on Kwikstik is that Kwikstik does not have any buttons or leds available.

We have tried to create this application as simple as possible to be able to support it on all Kinetis boards. There is ProcessorExpert.pe project for Kwikstik but it contains just CPU initialization. You can add your own components (GPIO, ADC,,,) and check it. It should not be difficult.

If you have some troubles let me know what do you specifically need

Petr

0 Kudos
593 Views
anguel
Contributor V

Petr,

So there is no pe_demo but PEx is supported on the Kwikstik, do I understand correctly? Or do I have to do more modifications if I add ADC for example on this board in contrast to other boards?

Anguel

0 Kudos
593 Views
petr_uhlir
NXP Employee
NXP Employee

>> So there is no pe_demo but PEx is supported on the Kwikstik, do I understand correctly?

Yes there is no pe_demo for Kwikstik. But you can open ProcessorExpert.pe in kwikstikk40x256 bsp and add ADC or any component you would like to test.

0 Kudos
593 Views
anguel
Contributor V

Ok, what I don't understand is where I should put my MQX tasks and code. If I generate PEx code an Events.c and Events.h files are generated in the "Sources" folder of the BSP project. Should I put my tasks etc. in new C files in the same "Sources" folder or should I try to create a separate project like it is done for the pe_demo for the other boards?

Anguel

0 Kudos
593 Views
petr_uhlir
NXP Employee
NXP Employee

Anguel,

PEx is integrated into BSP library.  So you have 2 options. Put your isr code into Events.c or in your application create some C file with events like pe_demo. If the event has the same name, the linker overloads its instance in BSP library by the instance from application. Your tasks are usually created in application or in some cases like some high level drivers or stacks also in library. Check for example function _io_pcb_mqxa_ioctl()

There is "io_pcb_mqxa_read_task" private task created using _task_create() function from local task template list input_tt.

Regards Petr

0 Kudos
593 Views
anguel
Contributor V

Peter,

Sorry but I am still confused. Please tell me how I can create a fresh MQX project that makes use of the PEx BSP project for the KWIKSTIK.

My problem is that the pe_demo projects are all configured for different boards, pointing to different MQX libs and have different debugger settings etc. And the KWIKSTIK BSP project containing the PEx does not seem to be set to have a main.c file.

UPDATE: I tried creating a fresh new MQX project as well as porting the pe_demo for the TWRK40x256 to the KWIKSTIK by renaming everything with "twr" to "kwikstik" in all project config files, then removing the PWM and LED stuff and setting the debugger to J-Link. Now the projects compile ok but when I run the programs on the KWIKSTIK the debugger halts at the following code in dispatch.S:

ASM_LABEL(_int_kernel_isr)

                cpsid.n i

Thanks in advance,

Anguel

0 Kudos