How to use USB bootloader (AN3748) with Processor Expert in CW6.2?

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

How to use USB bootloader (AN3748) with Processor Expert in CW6.2?

5,009 Views
dafodil
Contributor III

My project works with  MCF51JM64, I used PE in CW6.2 to create all this project.

I tried USB bootloader (AN3748), it's very interesting to make software updates, and works fine :smileyhappy: , but without Processor Explorer.... :smileysad:

 

Do you have any tutorial or any idea to use USB bootloader (AN3748) with PE?

 

Regards

Bernard

Labels (1)
0 Kudos
51 Replies

1,803 Views
BlackNight
NXP Employee
NXP Employee

Hi Bernard,

see attached screenshot: in the Component Library there is a symbol telling if things are licensed or not. Plus if you hoover over it, it gives you the status too.

 

Hope this helps,

BK

0 Kudos

1,803 Views
dafodil
Contributor III

BK,

 

With CW10.2, I think that I live in a Murphy's World...

 

It's impossible to find the licence information. See the print screen attached.

 

Bernard

0 Kudos

1,803 Views
BlackNight
NXP Employee
NXP Employee

Bernard,

oh, I was under the impression you use classic CodeWarrior, not the eclipse based one. So my screenshot is from classic, and yours is from Eclipse. And indeed, the Eclipse one does not show that information.

 

BK

0 Kudos

1,803 Views
wrljet
Contributor II

BlackNight wrote:

Hi Bill,

yes, it should be part of CW 6.3 as well. It is the component to program the internal flash. But I think it is not available in the free special edition, maybe this is your problem.

In any case: the IntFlash component is used only to store the touch screen calibration data in flash. You can go without it if use pre-programmed calibration values or use another way to store your calibration values.

 

Hope this helps,

BK


I do have the free edition.

 

It seems to be used by BL_Flash_Prog(), which is used by BL_OnSRecord().

 

Bill

0 Kudos

1,803 Views
BlackNight
NXP Employee
NXP Employee

Hi Bill,

oh, I see. I mixed it up with the LCD calibration thing.

You are right: it is used by the flash programming of the S19 files, indeed :smileysad:.

But you should be able to use the file generated which is in the zip file?

 

BK

0 Kudos

1,803 Views
wrljet
Contributor II

Yup, I can try the IntFLASH file from the zip.

 

Next question, I'm trying to build the TWR-LCD JM128 project itself, in CW 10.2.

Seems like the FreeRTOS component is looking for TickCntr which is missing.

 

undefined identifier 'TickCntr1_TValueType'    port.c    /TWR-LCD JM128/Generated_Code    line 181

 

I'm using FreeRTOS_1.195_07.07.2012.PEupd

 

Bill

 

0 Kudos

1,803 Views
BlackNight
NXP Employee
NXP Employee

Oh, indeed. My fault. I have screwed up the timer type. Fixed now.

 

Correct would be:

 

portLONG uxGetTickCounterValue(void) {  TickCntr1_TTimerValue val;  (void)TickCntr1_GetCounterValue(&val);  return (portLONG)val;}

 You could change the type directly inside port.c (for me it is in C:\ProgramData\Processor Expert\CWMCU_PE5_00\Drivers\freeRTOS\port.c).

Or you use the 1.196 version I just have uploaded:

http://www.steinerberg.com/EmbeddedComponents/FreeRTOS/FreeRTOS_1.196_09.07.2012.PEupd

 

Sorry about that, and thanks for reporting!

BK

0 Kudos

1,803 Views
wrljet
Contributor II

Thanks BK for that update.

 

That got me farther.  I'll update a bit later with progress.

 

Bill

 

0 Kudos

1,803 Views
wrljet
Contributor II

BK,

 

I've got it all work in CW 10.2 now, on a DEMOJM board. Took some fiddling.

(and a lot of swearing, getting used to Eclipse)

 

But now I come to this question...  When I debug the app project directly from CW, clicking the

little bug icon, the status output that flies by as the BDM is erasing and programming the

MCU appears to be erasing the entire chip.  But when I look at the memory in the debugger,

the contents of low memory is still there from the Bootloader project.


What am I missing?  I know the app's S19 file doesn't specify contents for that bootloader area

down low, but why is it not being erased?

 

I have a feeling when I move to my target board and use open source USBDM it will erase

the entire chip and blow away the bootloader.

 

Bill

 

0 Kudos

1,803 Views
BlackNight
NXP Employee
NXP Employee

Hi Bill,

I think I have disabled erasing the part where the bootloader is in my debug settings. Makes sense as I do not want to overwrite it (normally).

Have a look at this article:

http://mcuoneclipse.wordpress.com/2012/04/27/programming-part-of-flash/

You can disable the settings (protection of a flash area).

 

Let me know if you need more information on this.

 

Hope this helps,

BK

0 Kudos

1,803 Views
wrljet
Contributor II

Ahh, OK, found that in the dialogs.  Man, Eclipse sure runs you around looking for things!

 

Now I just have to talk pgo into making that "preserve range" feature work in USBDM

that I use for my target hardware.


Thanks again, BK.  Your excellent work (and sharing it) is very much appreciated.

 

Bill

 

0 Kudos

1,803 Views
wrljet
Contributor II

Yes, thank you.  That's a big help.

 

Bill

 

0 Kudos

1,803 Views
dafodil
Contributor III

Hi BlackNight,

 

I need your help again :smileysad:

Last time the bootstrap seems to works with the message "SUCCESS.TXT".

So, I tried to test my application..., but I can start it.

With the CW10.2 debugger, I read the memory just after display of  "SUCCESS.TXT" and I found only values of FFFFFFFF from 0x04C00 to 0x0FFE0.

 

Do you know what's append?

 

Bernard

0 Kudos

1,803 Views
BlackNight
NXP Employee
NXP Employee

Hi Bernard,

If it is 0xff, then the bytes have not been programmed.

 

Otherwise: can you check if your S-Record has the code in the correct memory area?

See the defines below (bootloader.c): memory below 0x47FF will be ignored.

Are you using the MCF51JM128? The CPU_DERIVATIVE_MCF51JM128 define is defined by Processor Expert.

 

 

#ifdef CPU_DERIVATIVE_MCF51JM128
  #define CF_CORE
  #define MIN_RAM1_ADDRESS            0x800000
  #define MAX_RAM1_ADDRESS            0x803FFF
  #define MIN_FLASH1_ADDRESS          0x000000
  #define MAX_FLASH1_ADDRESS          0x01FFFF
  /* bootloader is in 0x410...0x47FF */
  #define FLASH_PROTECTED_ADDRESS     0x0047FF /* flash below this address will be protected (e.g. bootloader) */
  #define REDIRECT_VECTORS            0x004800
  #define USER_ENTRY_ADDRESS          0x004A00 /* stub code to _Startup */
  #define BL_APP_RAM_VECTOR_ADDRESS   0x800000  /* application vectors in RAM */
  #define FLASH_PAGE_SIZE             1024
#endif


 

Hope this helps,

BK

0 Kudos

1,803 Views
dafodil
Contributor III

Hi BK,

 

Yes, the bytes are not progammed.

 

I take a look at S-Record (I attached it), and the address for vector is 0x4800, application is 0x4C00.

 

But I use a MCF51JM128 with configuration for JM64 because I have some boards with JM64 and I have a free license until now.

 

I changed this

  #define MAX_FLASH1_ADDRESS          0x00FFFF
when I start to work with JM64 (bootloader.c)

And I comment #ifdef

So it looks like now

 

//#ifdef CPU_DERIVATIVE_MCF51JM128
  #define CF_CORE
  #define MIN_RAM1_ADDRESS            0x800000
  #define MAX_RAM1_ADDRESS            0x803FFF
  #define MIN_FLASH1_ADDRESS          0x000000
  #define MAX_FLASH1_ADDRESS          0x00FFFF
  /* bootloader is in 0x410...0x47FF */
  #define FLASH_PROTECTED_ADDRESS     0x0047FF /* flash below this address will be protected (e.g. bootloader) */
  #define REDIRECT_VECTORS            0x004800
  #define USER_ENTRY_ADDRESS          0x004A00 /* stub code to _Startup */
  #define BL_APP_RAM_VECTOR_ADDRESS   0x800000  /* application vectors in RAM */
  #define FLASH_PAGE_SIZE             1024
//#endif

 

What do you think about this?

 

Bernard

 

 

0 Kudos

1,803 Views
BlackNight
NXP Employee
NXP Employee

Hi dafodil,

yes, I would try this with these settings.

Just keep in mind not to re-generate/overwrite your source change (prevent Processor Expert to generate code for this component).

This reminds me that it would be better to make the settings exposed in the component. I'll see what I can do.

 

BK

0 Kudos

1,803 Views
dafodil
Contributor III

BK

ok, I agree.

Didi you take a look at S19 file?

It looks good, no?

 

0 Kudos

1,803 Views
BlackNight
NXP Employee
NXP Employee

Hello,

at a glance, the S19 file looks ok to me (but I have not tried it out).

 

BK

0 Kudos

1,803 Views
dafodil
Contributor III

Hi BK,

 

I am trying your project with CW for MCU 10.1.

After importation of the project and all PE components, I tryied to build the project.

I got this message on the console:

"**** Build of configuration MCF51JM128_Internal_Flash for project TWR-LCD JM128 Bootloader ****

L:\Program Files\Freescale\CW MCU v10.1\gnu\bin\make all
L:\Program Files\Freescale\CW MCU v10.1\gnu\bin\make: *** No rule to make target `../Project_Settings/Linker_Files/ProcessorExpert.lcf', needed by `TWR-LCDBootloader.elf'.  Stop.
"

ProcessorExpert.lcf exist allready in the good folder, I can't find TWR-LCDBootloader.elf.

 

I don't find how to solve this error.

Do you have an idea?

 

Regards

0 Kudos

1,803 Views
BlackNight
NXP Employee
NXP Employee

Hi dafodil,

"no rule to make target" in eclipse means that the make file is outdated (e.g. if you moved the project, or in your case if you imported it). So you need to re-generate the make file:

- select the project

- menu Project > Clean

and then build the project again.

 

The other thing not to miss: have you generated the code with Processor Expert?

to do this:

- make sure you have the Processor Expert views open: Menu Processor Expert > Show Views

- select the ProcessorExpert.pe in the 'Project Panel' view

- right click and select 'Generate Processor Expert Code'

- then build the project

 

Hope this helps,

BK

0 Kudos

1,803 Views
dafodil
Contributor III

Hi BK,

 

I come back on this project.

I work now with CW10.2, my project use MCF51JM128VLD.

I downloaded your project TWR-LCD JM128 Bootloader. (MCU MCF51JM128VLH)

"Build all" command works fine, only one warning about vector table (normal).

 

I got somme Errors with JM128 Bootloader when I tried to migrate to JM128VLD, I replaced some GPIO on some embedded components to solve error on processor expert.

The main error after "build all"

"Description    Resource    Path    Location    Type
function has no prototype    Boot.c    /TWR-LCD JM128 BootloaderModifie2/Sources/Bootloader    line 82    C/C++ Problem"
 

and source lines code in Boot.c are below, RTOS_Strat() is not know. Strange...

void BOOT_Start(void) {
#if PL_IS_BOOTLOADER
  BL_Bootloader(); /* does not return */
#else
  RTOS_Start(); /* does not return */
#endif
}

 

This same code is build when I don't change anything and JM128VLH.

 

I tried to add FreeRTOS component, but FreeRTOS don't generate RTOS.h....

 

I am again waiting for your help.

 

 

 

0 Kudos