Installing MQX on custom board

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

Installing MQX on custom board

3,217 Views
syedr
Contributor I

Hello,

I am currently working with the TWR-K60N512 dev kit ( with a PK60N512VMD100 chip) and MQX 3.8 and have a custom board with the MK60DN512LVQ10 chip. My code works and flashes without any problems on the dev kit.But whenever I try to debug the code on my custom board with the MQX I run into problems. First off my code is able to flash on the custom board, but the pointer immediately jumps to the dispatch.s file in the _int_kernel_isr function, it stops right at the "cpsid.n i" instruction. When I press the debug button again the pointer moves cortext_boot.s file at this assembly instruction:       

ldr r0, =0xe000e180     ; NVIC_ICER0 - Interrupt Clear-Enable Registers

If I keep pressing the resume button on my debugger the pointer keeps moving back and forth between these two files.

I have tried changing the MQX settings in my user_config.h file for MQX_ROM_VECTORS from true to false. When I have it set to true the above problem is encountered and when I set it to false the pointer starts off in the vectors.c file at the following while loop:

static void __boot_exception(void) {

        while(1);

    }

Also at random times during debug, the code starts off at the mqx_main.c file but ends up in the cortex_boot.s file.

I have an idea that the problem is related to some interrupt but cannot point out how to debug this problem since I can't seem to bypass this issue during debugging. Also on a side-note  I have compiled non MQX based code and flashed it to my custom board, and that worked without any problems and I was able to debug and step through my code.

Any help on this would be greatly appreciated.

Thanks

Tags (4)
5 Replies

1,738 Views
chiasyan
Contributor II

Hi,

When you clone the BSP, the "user_config.h" file is cloned exactly the same as the original. So here is my workaround, try to disable any options in "user_config.h" which are not intended to be used in your custom board.

I haven't dug deeper enough to find the root cause of this problem but it works for me for now.

:smileyplain:

Thank you.

0 Kudos
Reply

1,739 Views
Angelillo
Contributor III

Hi,

I have had the same problem to change MQX_ROM_VECTORS from true to false. In my case, I solved the problem disabling TAD option in: Run --> Debug Configurations --> tab "Debugger" --> OS Awareness --> Option: "None".

I'm not sure but I think that the origin of problem is an insufficient RAM memory using TCP/IP Stack (RTCS).

I hope I've been helpful for you.

Thank you,

Best regards,

1,739 Views
Angelillo
Contributor III

Hi,

One more thing: MQX_SPARSE_ISR_TABLE = TRUE for optimizing RAM memory with interrupts.

Thank you,

Best regards,

0 Kudos
Reply

1,741 Views
syedr
Contributor I

Thank you the response. I have tried what you suggested and now the when my debug session starts the pointer stops in the vectors.c file at the following code

    #define DEFAULT_VECTOR  _int_kernel_isr

#else

    static void __boot_exception(void) {

        while(1); // pointer starts off here

    }

When I press the debug button again, it goes into the cortex_boot.s file at the following code ( in the _boot function)

ASM_LABEL(__boot)

        ; disable interrupts and clear pending flags

        ldr r0, =0xe000e180     ; NVIC_ICER0 - Interrupt Clear-Enable Registers   // pointer moves here

        ldr r1, =0xe000e280     ; NVIC_ICPR0 - Interrupt Clear-Pending Registers

        ldr r2, =0xffffffff

        mov r3, #8

When I pres the debug button again it switches back to the vectors.c file at the code I pasted above.  Basically, now it just skips between these files at the same code location.

Can you provide any ideas as to what I might be doing wrong?

0 Kudos
Reply

1,741 Views
Angelillo
Contributor III

Hi,

I've had a similar problem. I think that your ISR vector installation hasn't succeeded and now the CPU is running the Default_ISR vector (CPU always execute _int_default_isr for all unhandled interrupts). In my case, I've had a problem with my included paths of my project when I'm using my custom BSP. I recommend you that you use the default BSP. When your ISR is running well you will be able to change to custom BSP.

Thank you,

Ángel G.

0 Kudos
Reply