CW10, MQX 3.6 Examples EVB51Jm128

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

CW10, MQX 3.6 Examples EVB51Jm128

2,453 Views
WHookway
Contributor III

Hi,

I am trying to run MQX 3.6 examples on the EVB51JM128 using CW10.  Shouldn't I just be able to import an example (gpio_m51jmevb) for example and have all the pieces needed to run.  I have to add the processor expert to the project to select a target CPU.  When I build I get an undefined _startup.  I cannot find the example build documentation for CW10 that provides any guidance on running examples with this IDE.

Thank You

Will

Labels (1)
0 Kudos
12 Replies

811 Views
ARQuattr
Contributor IV

I'm having a similar issue that the OP  WHookway was having, in that I'm trying to add Processor expert to an existing MQX project.  I created a new MQX 3.6 project in CW10 and enabled Processor Expert.  I added some I/O and generated PE code, but now I have a main () in ProcessorExpert.c and Main_task in main.c.  If I try to compile I get a similar error ithe OP had (undefined identifier '_startup') as well as what is probably the cause of that error (#include "startcf.h"  >the file 'startcf.h' cannot be opened).

 

If I create a bareboard project I get the option to use Processor Expert, but if I create an MQX 3.6 project, I don't have that option, so what's the best way to create a new project with both?

 

Many thanks

0 Kudos

811 Views
TudorS_
NXP Employee
NXP Employee

Does this happen only with a MQX supplied example? Or does it also happen with a simple MCF52233 or M52233DEMO stationery project with the internal flash targets?

 

Tudor

0 Kudos

811 Views
TudorS_
NXP Employee
NXP Employee

More about this, regarding the console tab:

 

Printing program output in the console tab requires the Console IO exception handlers, as can be seen from the code in a CONSOLE RAM stationery project. If the code supplied in the MQX example doesn't implement these handlers, then the console won't print the output.

 

The sources in the FLASH stationeries also provide an example of UART output capabilities via the printf() implementation supplied in the runtime libs.

 

These are the two possibilities of viewing program output.

 

Tudor

0 Kudos

811 Views
TudorS_
NXP Employee
NXP Employee

Hello all.

 

Let me try to summarize the setup needed for the "Execute tasks" debugger option. This option has been developed to support scenarios where the hardware probe did not permit downloading directly into FLASH, such as OSBDM or P&E USB Multilink on ColdFire v2-v4.

 

Therefore please check that you have the following options set according to the memory and probe used for download:

 

ColdFire v1 FLASH + OSBDM: "Execute tasks" checked, "Perform Standard Download" unchecked

ColdFire v1 FLASH + P&E USB Multilink: "Execute tasks" unchecked, "Perform Standard Download" checked

ColdFire v2-v4 FLASH any probe: "Execute tasks" checked, "Perform Standard Download" unchecked

ColdFire v1-V4 RAM any probe: "Execute tasks" unchecked, "Perform Standard Download" checked

HCS08/RS08 FLASH or RAM + P&E USB Multilink: "Execute tasks" unchecked, "Perform Standard Download" checked

HCS08/RS08 FLASH + OSBDM: "Execute tasks" checked, "Perform Standard Download" unchecked

HCS08/RS08 RAM + OSBDM: "Execute tasks" unchecked, "Perform Standard Download" checked

 

These might not always correspond with the settings in the out-of-the box MQX imported examples.

 

Also, please check that in the target tasks list, each target task has associated the desired run configuration, instead of "Active debug context". This is just a precaution.

 

Tudor

0 Kudos

811 Views
nordy
Contributor I

Tudor:

 

Thanks for the input, but your recommendation for Flash debug on v2-v4 doesn't seem to work (in fact, just such a problem is the bulk of the discussion in this thread). Setting "Execute Tasks" to checked is what causes the error discussed above. The only way I've been able to debug is with BK's suggestion that the code be downloaded manually after a compile but before a debug session. Then, with "Execute Tasks" unchecked, the debug session works fine.

 

Am I missing something? (BTW, this occurs on Win7, 64-bit, using CW10 and the M52233DEMO board).

 

-- nordy

0 Kudos

811 Views
nordy
Contributor I

I'm having the same problem using the M52233DEMO board. I can execute the flash program task manually and it seems to download into the board, but fails as described by Will when trying to execute and debug. BTW, drilling down into the Debugger | Execute Tasks setting showed that checkbox ("Execute Tasks") to be checked. I unchecked it and hit "Debug" and was rewarded with an error message asking me to resolve the location of a project file. CW was expecting the file to be on C: drive, but I have CW10 and MQX installed on D: (along with the project directory). Is this a directory naming issue? If so, where do I define the "new" project and file locations to CW10? TIA.

0 Kudos

811 Views
BlackNight
NXP Employee
NXP Employee

Hello,

the M52233DEMO is a V2, and it needs the target task as part of the download/debug to flash the target, so that's why for this board in the debugger settings it needs to be checked.

To find out if the problems in the settings is in the MQX portion or not, I suggest that you try dowloading/connecting to the board without the MQX portion: for this create a new project using the 'new project' wizard (File New > then bareboard project, etc).

 

BK

0 Kudos

811 Views
nordy
Contributor I

BK, it looks like this isn't an MQX problem. I created a bareboard project and set the debug target for internal flash using the PnE USB BDM (usb connection). Everything compiles correctly. Then I set the debug configuration to the same target (internal flash) via the Debug Configuration window. But when I press "Debug" on that same panel, I get the "Problem Occurred" error dialog box that says "'Launching bareboard2_M52233DEMO_Internal_Flash_PnE USB BDM' has encountered a problem." The "Details" portion of the dialog is empty.

 

Again, I've got CW10 installed on my D: drive and have successfully recompiled the MQX libraries (although they're probably not coming into play in the simple bareboard project, right?)

 

BTW, clicking the green "Execute" button on the Target Tasks panel seems to erase the flash and download code into the board (the verification steps return a "Verify Command Succeeeded" message on the console). However, once that completes I get no console output from the code in main.c, so not sure the code is actually executing on the board.

 

Still struggling and confused. All help greatly appreciated.  --nordy

 

P.S. Just did a rebuild and rerun using internal console RAM as the target and the bareboard program runs fine and I can single step through the code. So the problem seems to be debugging using the on-board flash. Note: I have no reason to believe the on-board flash is bad. It worked the last time I used it (under CW "classic" 7.1). Again, all help greatly appreciated.

0 Kudos

811 Views
BlackNight
NXP Employee
NXP Employee

Hello,

yes, this confirms that this is not a MQX problem. What happens as part of the debug launch (with the target task enabled) that the debugger first executes the target task to flash the board, and then continues with debugging.

If you do RAM debugging, then the target task is not executed/needed, as the debugger directly writes into RAM.

So there must be something going wrong while running the target task as part of the debugging launch. Unfortunately the there is nearly no information available if something goes wrong in that part (with the debug launch).

 

And I agree: your board should be fine.

 

>>"BTW, clicking the green "Execute" button on the Target Tasks panel seems to erase the flash and download code into the board (the verification steps return a "Verify Command Succeeeded" message on the console). However, once that completes I get no console output from the code in main.c, so not sure the code is actually executing on the board."

Could you check the 'console' view? If you launch the target task standalone, then it writes to the console. Note that the console view has different views: click on the 'monitor' icon in it to view the different views. The target task will write out logging information to it. So here we should be able to see what is wrong. So maybe you could post the output here?

 

Now: if this was going well (means: it has flashed the image to the target), then you should be able to debug the application. For this go into the launch/debug configuration and disable the target task (so it is not used during debug) and disable 'perform standard download'.

 

Hope this helps,

BK

0 Kudos

811 Views
nordy
Contributor I

Thanks, BK. Here are the outputs from both the Protcol Log console view and the Flash Programmer console when I manually invoke the flash programmer in CW:

 

Protocol log console:

 

Info: USB-ML-CF detected - Flash Version 5.51Info: USB-ML-CF detected - Flash Version 5.51Info: Connection status: connected.Info: ColdFire Interface Libraries Version 3.49.00.02 (http://www.pemicro.com)Info: USB-ML-CF detected - Flash Version 5.51Info: USB-ML-CF detected - Flash Version 5.51Info: USB-ML-CF detected - Flash Version 5.51

 

Flash Programmer console:

 

fl::target -lc "gpio_m52233demo_Int_Flash_Release_PEBDM"fl::target -b 0x20000000 0x8000fl::target -v on -l off -ie on -i "D:/Program Files (x86)/Freescale/Freescale MQX 3.6/mqx/examples/gpio/cw10/gpio_m52233demo/../../../../../lib/m52233demo.cw10/mqx/dbg/m52233demo.cfg" -p MCF52233cmdwin::fl::device -d "CFM_MCF52233" -o "8Kx32x1" -a 0x0 0x3ffffcmdwin::fl::image -f "D:\\Program Files (x86)\\Freescale\\Freescale MQX 3.6\\mqx\\examples\\gpio\\cw10\\gpio_m52233demo\\Int Flash Release\\intflash.elf" -t "Auto Detect" -re off -oe offcmdwin::fl::erase image Beginning Operation ...    ------------------------- Auto-detection is successful.     File is of type Elf Format.    Initializing remote connection ...    Performing target initialization ...     Downloading Flash Device Driver ...    Reading flash ID ...System clock check checking ...   Erasing Sector 0x00000000 to 0x000007FF ...    Erasing Sector 0x00000800 to 0x00000FFF ...    Erasing Sector 0x00001000 to 0x000017FF ...    Erasing Sector 0x00001800 to 0x00001FFF ...    Erasing Sector 0x00002000 to 0x000027FF ...    Erasing Sector 0x00002800 to 0x00002FFF ...    Erasing Sector 0x00003000 to 0x000037FF ...    Erasing Sector 0x00003800 to 0x00003FFF ...    Erasing Sector 0x00004000 to 0x000047FF ...    Erasing Sector 0x00004800 to 0x00004FFF ...    Erasing Sector 0x00005000 to 0x000057FF ...     Erasing ... Erase Command Succeeded    cmdwin::fl::write Beginning Operation ...    ------------------------- Programming file D:\Program Files (x86)\Freescale\Freescale MQX 3.6\mqx\examples\gpio\cw10\gpio_m52233demo\Int Flash Release\intfl ash.elf   Auto-detection is successful.     File is of type Elf Format.     Downloading Flash Device Driver ...    Reading flash ID ...System clock check checking ...   Auto-detection is successful.     File is of type Elf Format.    Downloading 0x00000418 bytes to be programmed at 0x00000000    Programming .... Program Command Succeeded    Downloading 0x00004F60 bytes to be programmed at 0x00000420    Programming .... Program Command Succeeded    cmdwin::fl::verify Beginning Operation ...    ------------------------- Verifying file D:\Program Files (x86)\Freescale\Freescale MQX 3.6\mqx\examples\gpio\cw10\gpio_m52233demo\Int Flash Release\intflas h.elf   Auto-detection is successful.     File is of type Elf Format.    Reading 0x00000418 bytes starting from address 0x00000000   Reading 0x00004F60 bytes starting from address 0x00000420   Verify Command Succeeded  

Everything appears to be correct (flash being erased, code downloaded and verified).

 

Next, as you suggested, I disabled (unchecked) the "Perform Standard Download" and "Execute Tasks" checkboxes on the Download tab of the Debug Configurations window. Then I clicked on the "Debug" button at the bottom of that same window and I was able to debug the application. Ah ha--success!

 

I notice that the printf output of the code (the gpio.c example) doesn't write to the CW console tab window as I step through the code. Should it? (In the "bareboard" app you had build and try, printf output went to the console). Where should I be looking to see this output? Also, when printf *does* write to the CW console (e.g. my bareboard example) how can I override/change that behavior and write to UARTx?

 

Thanks again BK for all your help.  --nordy

 

 

 

0 Kudos

811 Views
WHookway
Contributor III

Hi,

Update, I found the sample code tutorial.  I have imported a example (levent_m51jmevb) and have gone through the steps to debug from flash memory.  I am able to execute the target task to download the code image to flash.  However, when I select lwevent_m51jmevb_Int_Flash_Debug_PEBDM and attemp to debug I get an error message 'Launching lwevent_m51jmevb_Int_Flash_Debug_PEBDM' has encountereda problem.  A problem has occured."  There are no details.   If I invoke the target task I get the following:

 

fl::target -lc "lwevent_m51jmevb_Int_Flash_Debug_PEBDM"
fl::target -b 0x800000 0x4000
fl::target -v on -l off -ie on -i "C:/Program Files/Freescale/Freescale MQX 3.6/mqx/examples/lwevent/cw10/lwevent_m51jmevb/../../../../../lib/m51jmevb.cw10/mqx/dbg/m51jmevb.cfg" -p MCF51JM128
cmdwin::fl::device -d "MCF51JM128_FLASH" -o "FLASH" -a 0x0 0x1ffff
cmdwin::fl::image -f "C:\\Program Files\\Freescale\\Freescale MQX 3.6\\mqx\\examples\\lwevent\\cw10\\lwevent_m51jmevb\\Int Flash Debug\\intflash_d.elf" -t "Auto Detect" -re off -oe off
cmdwin::fl::erase image
 Beginning Operation ...    
-------------------------
Initializing remote connection ...    
Performing target initialization ...    
Flash operation  ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
Detect Speed ...   
Detect Speed Succeeded. 4.285   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Programmed   
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Erasing ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Blank   
Erase Command Succeeded.   
Flash operation done
   
cmdwin::fl::write
 Beginning Operation ...    
-------------------------
Flash operation  ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Blank   
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming .....
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming ......
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming ......
Program Command Succeeded    
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Programmed   
Flash operation done   
cmdwin::fl::verify
 Beginning Operation ...    
-------------------------
C:\Program Files\Freescale\Freescale MQX 3.6\mqx\examples\lwevent\cw10\lwevent_m51jmevb\Int Flash Debug\intflash_d.elf   
Flash operation  ...
Auto-detection is successful.   
  File is of type Elf Format.   
 
Verify Command Succeeded   
Flash operation done   
fl::target -lc "lwevent_m51jmevb_Int_Flash_Debug_PEBDM"
fl::target -b 0x800000 0x4000
fl::target -v on -l off -ie on -i "C:/Program Files/Freescale/Freescale MQX 3.6/mqx/examples/lwevent/cw10/lwevent_m51jmevb/../../../../../lib/m51jmevb.cw10/mqx/dbg/m51jmevb.cfg" -p MCF51JM128
cmdwin::fl::device -d "MCF51JM128_FLASH" -o "FLASH" -a 0x0 0x1ffff
cmdwin::fl::image -f "C:\\Program Files\\Freescale\\Freescale MQX 3.6\\mqx\\examples\\lwevent\\cw10\\lwevent_m51jmevb\\Int Flash Debug\\intflash_d.elf" -t "Auto Detect" -re off -oe off
cmdwin::fl::erase image
 Beginning Operation ...    
-------------------------
Initializing remote connection ...    
Performing target initialization ...    
Flash operation  ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
Detect Speed ...   
Detect Speed Succeeded. 4.614   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Programmed   
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Erasing ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Blank   
Erase Command Succeeded.   
Flash operation done
   
cmdwin::fl::write
 Beginning Operation ...    
-------------------------
Flash operation  ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Blank   
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming .....
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming ......
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming ......
Program Command Succeeded    
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Programmed   
Flash operation done   
cmdwin::fl::verify
 Beginning Operation ...    
-------------------------
C:\Program Files\Freescale\Freescale MQX 3.6\mqx\examples\lwevent\cw10\lwevent_m51jmevb\Int Flash Debug\intflash_d.elf   
Flash operation  ...
Auto-detection is successful.   
  File is of type Elf Format.   
 
Verify Command Succeeded   
Flash operation done   
fl::target -lc "lwevent_m51jmevb_Int_Flash_Debug_PEBDM"
fl::target -b 0x800000 0x4000
fl::target -v on -l off -ie on -i "C:/Program Files/Freescale/Freescale MQX 3.6/mqx/examples/lwevent/cw10/lwevent_m51jmevb/../../../../../lib/m51jmevb.cw10/mqx/dbg/m51jmevb.cfg" -p MCF51JM128
cmdwin::fl::device -d "MCF51JM128_FLASH" -o "FLASH" -a 0x0 0x1ffff
cmdwin::fl::image -f "C:\\Program Files\\Freescale\\Freescale MQX 3.6\\mqx\\examples\\lwevent\\cw10\\lwevent_m51jmevb\\Int Flash Debug\\intflash_d.elf" -t "Auto Detect" -re off -oe off
cmdwin::fl::erase image
 Beginning Operation ...    
-------------------------
Initializing remote connection ...    
Performing target initialization ...    
Flash operation  ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
Detect Speed ...   
Detect Speed Succeeded. 4.615   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Programmed   
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Erasing ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Blank   
Erase Command Succeeded.   
Flash operation done
   
cmdwin::fl::write
 Beginning Operation ...    
-------------------------
Flash operation  ...
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Blank   
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming .....
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming ......
Executing command WRITE BYTE at address 0xffff9824 with 0xff   
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Programming ......
Program Command Succeeded    
Executing command AND BYTE at address 0xffff9802 with 0x3f   
 Status Checking ....
Status Checking Succeeded. MCF51JM128_FLASH  Programmed   
Flash operation done   
cmdwin::fl::verify
 Beginning Operation ...    
-------------------------
C:\Program Files\Freescale\Freescale MQX 3.6\mqx\examples\lwevent\cw10\lwevent_m51jmevb\Int Flash Debug\intflash_d.elf   
Flash operation  ...
Auto-detection is successful.   
  File is of type Elf Format.   
 
Verify Command Succeeded   
Flash operation done   

Thank You,

Will

 

 

0 Kudos

811 Views
BlackNight
NXP Employee
NXP Employee

You should not need to run a target task for P&E and the JM128: the P&E cable will do the flash programming automatically. Could you check your debugger download settings:

menu Run > Debug Configurations, then select your debug configration.

Debugger Tab > Download > Execute Task.

if you have a target task enabled there (check box 'Execute Task'), then this is probably a problem with the MQX project setup.

Could you disable the option and try again if this helps?

 

BK

0 Kudos