Hey Ef,
Thanx for the link. You've approached the issue in exactly the same way that I have (I started with simply implementing a UART interface and now that the other software is working, I'm doing the USB) with many of the same issues that you seem to have had (I'm also working with the same basic files with the exception of register declares, as noted below).
A couple of questions, I was going to ask off line, but they might be of use to others on the list:
1. What version of CW are you using? I would like to use 7.2 (the latest) rather than 6.3 which the CMX documentation (and apparently the code) was written around.
2. I think there's a typo in the attached design notes, the apnote is 3492 and not 3462 as quoted in it.
3. What did you do about register declarations? The code uses a file called "mcf5222x_reg.h" rather than "mcf52223.h" that was provided by Freescale. I've been reworking the various USB files to use the Freescale declarations rather than support two different sets of register declares.
4. For the BDT declaration, I've modified the .lcf files to include:
___bdt_size = 0x200;
with heap & stack size declarations as well as modifying the ".custom" declaration to:
.custom :
{
___HEAP_START = .;
___heap_addr = ___HEAP_START;
___HEAP_END = ___HEAP_START + ___heap_size;
___SP_END = ___HEAP_END;
___SP_INIT = ___SP_END + ___stack_size;
___BDT_END = ___SP_INIT;
___BDT_BASE = ___BDT_END + ___bdt_size;
. = ALIGN (0x200);
} >> userram
with the declare statement:
__BDT_BASE = ___BDT_BASE;
added later. Everything seems to make correctly,but during linking I'm getting an error message:
'All segments to userram have to begin at address aligned to 512
Please add ".=ALIGN(512);" before every "} >> userram"'
What should I be doing here to fix the problem, I've tried to add a few of these statements, but I continually get error messages? Is there anything else that should be done?
As I'm using CS 7.2, I would like to use Processor Expert (PE) and part of this is trying to figure out the right way of doing the USB initializations. Has anybody done this successfully? I want to use PE to avoid having two hw initializations which may interact badly and being able to put in the USB interrupt handler directly without having to modify the functions directly.
Thanx for your help & suggestions!
myke