CMX Stack - JM60

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

CMX Stack - JM60

4,843 Views
UtopiaTim
Contributor III
Hi all,
 
I am using the CMX terminal demo as a method of transferring data into the PC.
 
I successfully got the program to do what it's supposed to with all files still in the
CMX directories as downloaded from the F'scale site.
 
The next thing I did was to relocate the files (still using the original CW setup),
and place them into the 'sources' directory.  All worked fine.
 
I started a 'new project' in CW, and transferred all of the required files into the
new 'sources' directory.  After fixing all of the directory related errors, I am getting
about 88 errors, mainly around a 'hcc_u8 not declared', or 'BITx not declared'.
 
To further debug, I have both projects open in two separate CW windows, and
have compared all setups & made sure they are the same... search paths, compiler
options, link order, etc.  All appear identical.
 
Anybody have any ideas?
 
BTW, I called CMX, but they are at some show this week, so support is evidently
minimal.

Thanks,

Tim
Labels (1)
0 Kudos
Reply
25 Replies

1,793 Views
JimDon
Senior Contributor III
Well, don't look to CMX to solve this problem, if their code builds and works, their job is done.

I have tried that with the CMX code, and finally decided to clone the project and them mod it.

hcc_u8 is a CMX defined type for a byte I believe. Where is it defined?


0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
Hi Jim,
 
I figured that it was a F'scale support issue, but when I talked to CMX's receptionist,
she implied that they were doing the support.
 
Anyhow, in the test I described, the only changes to the code I did was to reposition
the files into a different directory. (and start a new CW project)
 
usb.c has the following:
 
typedef struct {
  volatile hcc_u32 tlength;
  volatile hcc_u32 maxlength;
  void * volatile address;
  volatile usb_callback_t data_func;
  hcc_u16 psize;
  volatile hcc_u8 state;
  volatile hcc_u8 flags;
  volatile hcc_u8 error;
  volatile hcc_u8 data0;      /* Data toggle bit for endpoint. */
} ep_info_t;

Thanks,

Tim
0 Kudos
Reply

1,793 Views
JimDon
Senior Contributor III
They will do support for issues related to how the code works, but like I said I don't think this is an issue with their code.

In which header.is this defined? Some times other things need to be defined to make other defines become visible.



0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
Hi Jim,
 
I found this in usb_cdc.c:
 
 
/****************************************************************************
 ************************** Module variables ********************************
 ***************************************************************************/
/* Buffer long enouh to hold one USB frame. (Length equals to rx packet
   size. */
static hcc_u32 rx_buffer[32/4];
static hcc_u8 rx_length;
static hcc_u8 rx_ndx;
/* Buffer long enouh to hold one USB frame. (Length equals to tx packet
   size. */
static hcc_u8 *cur_tx_buffer;
static hcc_u32 tx_buffer1[32/4];
static hcc_u32 tx_buffer2[32/4];
static hcc_u8 tx_ndx;
static hcc_u8 new_line_coding;
static hcc_u8 line_coding[7] = {
  FILL_LINE_CODING(115200, 0, 0, 8) /* Default is 115200 BPS and 8N1 format. */
};
static hcc_u8 ctrl_line_state;
 
 
 
I guess the main question is that if I have two separate CW projects, each with the identical
code located in the same relative directories, have the same link order, same compile options,
etc, why am I getting errors?
 
Seems that it is something in CW that I'm not finding.

Thanks,

Tim
 
 
 
 
 
0 Kudos
Reply

1,793 Views
CompilerGuru
NXP Employee
NXP Employee
Obviously something is not identical in your two projects,
what I would do is to compare the preprocessor output of a file which fails to compile with the same file in the working mcp.

Daniel
0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
Hi Daniel/Jim,
 
Found the problem.  Evidently when CMX started their project, they selected
floating point format in the wizard, as opposed to none.

When I re-did the wizard selecting the Float option, the program worked.
 
Now, I guess to make it work, I will also have to do my project with Floating
point selected.  Wonder how much that will make it grow?  Time will tell.
 
Thanks,
 
Tim
0 Kudos
Reply

1,793 Views
JimDon
Senior Contributor III
If you don't use floating point, probably 0.
Can you find where they used it?

0 Kudos
Reply

1,793 Views
CompilerGuru
NXP Employee
NXP Employee
Some functions like sprintf or sscanf will support float once you link against a library which is using float, so the effect might be >0, but if those functions are not used, then a 0 overhead is possible too.

Daniel
0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
I've looked through all of the code, and don't find 'float'
anywhere -
 
I can look to see if there is any non-integer arithmetic,
but is there an easier way?
 
Tim
0 Kudos
Reply

1,793 Views
JimDon
Senior Contributor III
Use find in files and see if there is a "float" or "double" declaration or cast anywhere.

I suppose just writing x.x could cause it.
There are certain routines that the compiler will call if you do any floating point.

Add some floating point code, then step into the code and you will see them. Then  remove your test code and look in the map file to see if they still get link in.

It's really not an issue, I almost always create if a project with floating point just in case, since it is a pain to added it back later you need it. Still, I do wonder why it is that it demanded floating point.

It's not like you are almost out rom is it?






0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
No, I'm only up to $b000, so I've still got a ways to go.
 
When I initially started, I wasn't sure how big the project
would be, so I selected 'none' in the Wizard.  (based upon
the note beside it that said "select None for best code density").
I didn't plan on using any Floating Point.
 
I'll add some float code & try out what you suggested.  Maybe
I can find it that way.
 
Thanks,

Tim
0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
Well, for some reason, we're back to the 88 errors, even with the Float
option.
 
Not sure what changed.. something is quite unstable.  I used it yesterday
afternoon for a couple of hours & it worked fine.
 
Don't ya just love these 'free' packages?!
 
Tim
0 Kudos
Reply

1,793 Views
JimDon
Senior Contributor III
Well, I didn't want to say anything, but I found it a stretch that floating point was the problem.
Perhaps if you post the project and a zip someone will take a look at it from FSL.
 
0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
Hi Jim,
 
I agree - that seemed a stretch, but look at the following:
 
1.  Started with a clean version of the CMX terminal software
2.  Pulled all source codes from their various directories & put in source.
3.  Kept same .MCP as they had.
4.  Modified a few places in their code which referenced other directory
     entries... e.g. /../usb.c, etc.
5.  Compiled fine, hardware worked fine.
 
 - here's where it gets wierd:
 
Went to window where you change from hardware debug to simulator,
I got a different screen which had a lot more options than I normally see.
I selected full chip simulation.  When I clicked on 'debug', a sub screen came
up asking which device I wanted to use.  The JM60 wasn't on it.  (I'm using 6.1
with the JM60 patch).  Went back to try & use the Cyclone pro, & got same
window with 'choose device'.
 
OK, so I click on the icon of a chip, and the HC08 family is shown.  I click on
HCS08... JM60, click on cyclone pro, & finish.
 
Voila, the 88 errors magically re-appear!
 
Think it's time to call F'scale.
 
Thanks,

Tim
0 Kudos
Reply

1,793 Views
JimDon
Senior Contributor III
Yes, do submit a service request.
If you can attach a project and give them steps to reproduce, you will get better results.
If they try and say no troubled found, get back to us and I will try to duplicate it.

Are you saying that you switch the target to simulator and then back?
Please clarify this.

I know this is a crappy answer, but try and redo the project as before but do not switch targets.
I might be possible to export the directories page where you changed stuff then import it back.

Then, don't change to simulator again.



Message Edited by JimDon on 2008-04-17 01:27 PM
0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
Hi Jim,
 
It's being worked as we speak.  It is easy to replicate using the
CMX code that is available from F'scale.
 
If you get into CW with the supplied .MCP file, switch to simulator
and try to run it, a dialog box will pop up asking you to select the
MCU.  Unfortunately, the JM60 isn't one of the offered selections!
It is only HC08 parts.
 
If you go to the chip icon to select the JM60, then it changes the
compiler command line (which in this case the software wants
a "-DUSB_CDC_TERMINAL" entry.  Even if you add that, when
you compile, it gives you 88 errors.
 
Since I want to use this code in my project, I really need to have the
simulator option working properly.

Tim
0 Kudos
Reply

1,793 Views
bigmac
Specialist III
Hello Tim,
 
It is likely that this is completely off-track, but are you using a third-party library that may have been compiled for HC08, rather than HCS08 device?
 
Regards,
Mac
 
0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
Hi Mac,
 
I'm just using the CMX code downloaded from the F'scale
web site.  Would think that the compiler would have some
problems with non-existent references if it were trying
to compile for the wrong part.  When you initially get into
the debugger, it does say S08JM60 as the target part on
the bottom of the screen.
 
I even did a fresh install of CW 6.1 with the JM60 patch just to
make sure that there wasn't anything funny going on.
 
It should be interesting to see what the real problem is.
 
I've also sent the folks at CMX an e-mail describing the
issues.  Most are at Imbedded this week, so it will probably
have to wait till they return.
 
Thanks,
 
Tim
0 Kudos
Reply

1,793 Views
JimDon
Senior Contributor III
Tim,
I think is it because there is not proper config information for the JM60 for the simulator.
So when you change the targets, it messes up the project.
I should also tell you, that in your case the simulator may not be of much use. Of course it can not simulate anything to do with the USB.

0 Kudos
Reply

1,793 Views
UtopiaTim
Contributor III
Hi Jim,
 
I never use the simulator to do anything with hardware, but it does come in
handy when checking out new software algos.
 
There is something strange about the CMX config - when you are in the IDE,
& select the 'change device' icon & select the JM60, it removes things from the
compiler command line arguments & even if restored to the original, the program
no longer compiles.  This is without changing to simulator or anything else.
 
Tim
0 Kudos
Reply