"Halt" Received on what appears to be the first instruction

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

"Halt" Received on what appears to be the first instruction

1,326 Views
myke_predko
Senior Contributor III

Hiya,

I have a host (PC) developer working on my application with a twrk20d72m Tower system that I have provided him along with the MQX application that I update periodically.  I am noting that this is happening with a third party because of geography, I can not see what's happening in the system myself. 

He has discovered that now (first noticed on Friday) that when he downloads updates from me (via CW) and tries to execute the application, he gets:

ARM Processors, robottest.afx (Suspended)

Thread [ID: 0x0] (Suspended: Signal 'Halt' received. Description: User halted thread.)     

2 main() mqx_main.c:47 0x0001f850

1 __thumb_startup() startup.c:185 0x000210f2        

Can anybody explain what this message is and what is the corrective action?  I cannot reproduce it on my systems.

This is on CW 10.4 and MQX 4.0.1 and the all the software has been reloaded to ensure nothing was inadvertently changed.

Thanx!

myke

0 Kudos
6 Replies

718 Views
c0170
Senior Contributor III

Hello myke,

what does log display? Is logging enabled?

If you share same project, is hardware properly and equally set on both sides? Same board, headers set same.

This halt problem usually happens when an access out of memory space happens (like stack overflow). You might receive more help in CW section for this type of problems.

Regards,

c1070

0 Kudos

718 Views
myke_predko
Senior Contributor III

Hi Martin,

Thanx for the reply.

I’m going to get the PCB back and try to understand what’s happening with it.

I’ll keep you posted.

myke

0 Kudos

718 Views
c0170
Senior Contributor III

Hello Myke,

one more thought, halt can be caused by undefined behavior caused by your code. A compiler can be a judge and generate halt signal to protect the application. I would ask this questions: Is it optimization ON? If yes, how does code change when it's set to 0? Where does it halt? Check disassembly, what are the instructions/or at least C code what it does.

Regards,

c0170

0 Kudos

718 Views
myke_predko
Senior Contributor III

Hi Martin,

I’ve just gotten the TWRK20D72M PCB back – questions back to you:

1. Which optimization is on?

2. How do I set code to 0?

3. Code looks good when I disassemble it

We’ve just gotten our prototype PCBs so I am going to assume that the problem is with my contractors set up (for now) as I am going to create a custom bsp for the product.

I’ll let you know how that works out.

myke

0 Kudos

718 Views
c0170
Senior Contributor III

Hello Myke,

any progress with halting?

I might have not stated it clearly, that halt signal is generated from the code.  That was my thought. . It is usual if code optimizations set to non-zero and code invokes undefined behavior. Therefore please verify compiler's optimizations. Are they enabled?

Where does that halt happen? mqx_main.c:47 0x0001f850 ? What are values of registers? PC, LP and others?

Regards.

0xc0170

0 Kudos

718 Views
myke_predko
Senior Contributor III

Hi Martin,

Nothing is happening on this – we just got our prototype PCBs in and I have

been spending time at debugging them.

I have four questions for you and Martin Látal regarding building a custom

bsp for our product – I would put this on the forums but when I click on

“Got a question, ask the Community?” link, I get:

<https://community.freescale.com/>

Oops, the page can't be found

Sorry, the page you requested can't be found. You can go back

<javascript:history.go(-1)> and try again, or start again at home

<https://community.freescale.com/> .

My product uses the MK20DN512VLL10 and there isn’t an existing bsp for it.

I have Martin Látal’s “Developing a New BSP/MQX 3.8.1, CodeWarrior IDE” as

well as the documentation on using the MQX “Cloning Wizard”. I have also

read through the MQX forum on the subject and worked through one sample

manually using Martin Látal’s document and one using the Cloning Wizard with

less than optimal results.

I think the problems arose because:

1. I had modified the base MQX files which caused numerous problems

with the two different approaches listed able. The changes were:

a. Adding “lwadc” to the bsp as per

https://community.freescale.com/thread/308825

b. Adding the I2C Interrupt driver as per

https://community.freescale.com/message/325704#325704

2. I did not correctly change the SDID which resulted in the projects

not being downloaded to the device.

The questions are:

1. Which “base” device should I use for the bsp? When I look at the

forums, I found this (https://community.freescale.com/thread/307573) thread

which indicated that for the MK20DN512VLL10 the twrk40d100m bsp should be

used. When I discussed this with my FAE (Derrick Klotz), he said that the

twrk60n512 should be used because the part used in it but when I look at the

schematics, it uses a 144 LFBGA and a 50Mhz clock. Doing some research, I

can see why the twrk40d100 was recommended but I just want to confirm what

is the best existing one to use for my application – the ideal would be a

pre-existing one. The parameters that I am look for are:

a. MK20DN512VLL10 100 pin LQFP package to be able to use the

predefined pins in the includes (and minimize the modifications to the

bsp_pin_function_definition_file.h (ie twrk20d72m.h)).

b. 100Mhz max speed with a 32.768 kHz and 8 MHz Clocks so that I don’t

have to come up with the clock settings myself.

2. What is the best method for creating the bsp in MQX 4.0.1? Part

of the problem that I am having is that when I modify/add/delete source

files in the current bsp that I am working with (ie for lwadc and I2C), I am

also finding that modifying the bsp for one device affects the bsp for other

devices which can be problematic.

3. How to update the SDID (System Device Identification) in the bsp

once it’s done? As I indicated, there seemed to be problems in not having

the correct SDID when programming the device with a test application once I

created the bsp. The examples that I have found, show how to create a new

bsp for the same device, not a different one (as I will have to do in this

case).

4. How to export the bsp so that it can be a) backed up and b) given

to other developers? As noted in the original thread here, my remote

contractor has some how caused a problem with his set up which causes the

system to not program correctly. If I was able to send him a bsp that he

can add to his system without repeating the modifications that I do, this

would be a huge advantage for us.

I have also made this a service request (

<https://www.freescale.com/webapp/servicerequest.clr_list_details_SR.framewo

rk?internalServiceRequestId=1-ILHRRV&serviceRequestNumber=1-1124492251&comma

ndType=VIEWOPENSR&isOver30DaysString=false&category=Software%20Product%20Sup

port&topic=CodeWarrior> 1-1124492251). Hopefully the questions are fairly

easy to answer.

Thanx!

myke

0 Kudos