This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PIL setup for TMS570 USB Kit

Other Parts Discussed in Thread: HALCOGEN, TMS570LS20216, TMS570LS20206

Hi

I read all your posts on PIL setup. thanks a lot for your support. Coming to point  I am planning to create a PIL setup for TMS570LS20SUSB. For this I have referred your PIL package for RM48. 

I have all required MATLAB products R2013a available and I performed all required changes for targetting TMS570.

Below are obstructing me from ending up with successful PIL setup creation.

1. I was left with setting up of Product Hardware Device Type in model configuration settings. For TI it is showing  only upto TMS470. which MATLAB version do I need to use for setting device type to TMS570 or Is there any other setting for the same?

2. Which version of CCS will be required for creating PIL setup for TMS570? 

3. Which version of Halcogen should be used for creating PIL setup for TMS570? Could you be more precise for performing PIL setup settings required for TMS570. Please share them because setting you have mentioned in RM48 package in not clear.

Thanking you in anticipation.

Regards

Chaitanya P V S

  • Hello Chaitanya,

    You can download Anthony Seelys PIL project and documentation from: http://www.mathworks.com/matlabcentral/fileexchange/authors/302264.
    There is a section of the help called 'making customizations' that explains how to change to TMS570.
    Basically any hercules product that is supported by HalCoGen is easy to switch to.

    More specifically, the answers to your software version requirements can be found here: http://www.mathworks.com/matlabcentral/fileexchange/46332-ti-hercules-rm48-040814-zip/content/TI_HERCULES_RM48_040814/TI_HERCULES_RM48/doc/html/gs/system_requirements.html#1

    I've also copied Anthony Seely who set all this up and was the primary contributor in prior threads in case there are additional questions that you wish to make directly to him.

  • chaitanya P said:
    I was left with setting up of Product Hardware Device Type in model configuration settings. For TI it is showing  only upto TMS470. which MATLAB version do I need to use for setting device type to TMS570 or Is there any other setting for the same?

      Now I'm wondering if I missed a step in the documentation.  Did you run sl_refresh_customizations after running the setup script? If not please try that.  I thought I had actually put that into the setup script but I don't see it. 

    This should work if you have the paths in the setup script added to the MATLAB path - which is automatically done for you when you run 'TI_HERCULES_RM48_setup.m'.   The toolchain is added when the sl_customizations.m in the utils folder is executed.  This happens when sl_refresh_customizations is called with the utils folder in the matlab path.  

    I think I left that step out of the instructions at least looking at the doc sources I don't see it.  Sorry about this if it turns out to be the problem.

    chaitanya P said:
    2. Which version of CCS will be required for creating PIL setup for TMS570? 

    Version # that was used to test with is in the help but there isn't anything very critical about the compiler as far as I know.   If you are using an older compiler you might need to adjust some of the compiler options - these are set in the file <install dir>\TI_HERCULES_RM48\utils\TI_HERCULES_RM48_toolchain.m.  

    I would say that if you can do the next step with a compiler verision (test the rtiostream standalone) you shouldn't have an issue with the compiler.

    chaitanya P said:
    3. Which version of Halcogen should be used for creating PIL setup for TMS570? Could you be more precise for performing PIL setup settings required for TMS570. Please share them because setting you have mentioned in RM48 package in not clear.

      You don't need any particular version of HalCoGen.  There are version #'s that I used in the help but in theory you don't need HalCoGen at all - you just need code that:

    •   initializes the device properly and gets you to the C main() starting point.
    •   supports the UART as the communication channel back to the PC
    •   supports the PMU for doing profiling


    It just happens that HalCoGen supports all three of the above criteria and works across Hercules so it's natural to use it -- but the ties to HalCoGen are pretty loose and it would be easy to change things up if you didn't want to use HalCoGen as the framework.

    Anyway I didn't go back and try the TMS570LS20216.  If I had to guess where a problem point would be likely it would be in the UART code - not sure if the UART code of the LS20216 has kept up with the UART code of the RM48.  There might be subtle differences in the way that you call send/receive that are different.  I am just speculating but I think this is much more likely than the startup code being a problem and PMU code is just some assembly functions that read/write PMU coprocessor registers.

    There is a test program for the UART rtiostream in <install dir>\TI_HERCULES_RM48\src\TI_HERCULES_RM48PilSerial.    It is TI_RM48HDKSerialRtiostreamTest.c.   This uses the RTIO stream functions that are called by the matlab generated code to just make a simple UART loopback or echo program.

    So you can debug the UART code by making a project that uses the code under <install dir>\TI_HERCULES_RM48\src\TI_HERCULES_RM48PilSerial with TI_RM48HDKSerialRtiostreamTest.c as your main() function.   This particular file is not included in PIL builds but it's in the distribution for just this purpose.  If you can make a loopback work with this test program then the rest of the files should be ready for a PIl build.

  • Hi Anthony,

    Thanks a lot for your solutions. I have analyzed those and started working on the same.

    I will let you know if I come across any further issues.

    Your support  is really grateful. 

  • Hi Anthoy,

    I need a clarification in the m file to be run after setup script ,Is it sl_refresh_customization or sl_customization as you have already provided in the PIL package.

    Regards,

    P.Wesley

     

     

     

  • Wesley,

    The command to issue is 'sl_refresh_customizations'.

    sl_customization.m is a file we provide that is read during the execution of the sl_refresh_customizations command.

    'doc sl_refresh_customizations' will give you the detail about what this command does, but one key point is that the sl_customization.m files that you want to be executed need to be in the MATLAB path so they can be found when the sl_refresh_customizations command is issued.

    (I tried color coding because the names are so similar - hope that helps distinguish between the .m file and the command that you need to execute).

  • thanks Anthony for the clarification - which m script to use when

  • Hi Anthony

    Thanks for giving us quick solutions

    can u please give me the steps in detail for the below:

    So you can - debug the UART code by making a project that uses the code under <install dir>\TI_HERCULES_RM48\src\TI_HERCULES_RM48PilSerial with TI_RM48HDKSerialRtiostreamTest.c as your main() function.   This particular file is not included in PIL builds but it's in the distribution for just this purpose.  If you can make a loopback work with this test program then the rest of the files should be ready for a PIl build.

    im using 570LS USB  for project

    Thanks and Regards

    P.Wesley

     

  • Wesley,

    Have you created a CCS project standalone before using HalCoGen?   If not then I would get HalCoGen (free download) and go through a few of the examples to get the hang of the process.

    Once you are comfortable doing this, then building the loopback test for TI_RM48HDKSerialRtiostreamTest.c is almost like any of the other HalCoGen examples.   You would run it standalone through CCS (not through matlab) and just make sure the UART is able to echo back what you send to it.   (if you don't have a 'terminal' program like Putty or Hyperterminal there is one built into CCS that you can use).

  • Anthony

    Thanks for your support

    As told by you i was able to run some Halcogen examples given by Ti and was good ,like

    BlinkyExample (Hit the reset button on the board and the NHET[1] LED should blink.)

    MibADCExample(Sensor data was sucessfully read back in terminal provided by (TI) )

    Then i started trying to run TI_RM48HDKSerialRtiostreamTest.c as suggested by you.

    But I failed .

    So I like you to give me some details in steps how would I take this to test SCI communication connect,as in MibADCExample,even though I tested  this project(MibADCExample) I like to test RM48HDKSerialRtiostreamTest.c

    for SCI commiunication. 

    Regards

    P.Wesley

  • Hi Wesley,


    How exactly did your testing w. the rtiostream fail?  Did it fail to compile or did it build and compile but not run.

    If you send me your project I can take a look at it for you...


    -Anthony

  • Anthony

    Let me jot in steps what I did (for I lost the code(deleted) )

    I followed the steps for Halcogen so I enabled SCI 1 only - from driver enable tab.(for i want serial communication )

    Then I generated the code .

    Then opened CCS and created a project with same name

    This hooks all Halcogen files created (sources and includes into project) with .dil and .hcg

    Is my understanding up till here correct if not suggest the necessary steps to be taken

    Then I opened sys_main file and copied contents of TI_HerculesRtiostreamTest.c file to it to make it a main file

    here is were I failed to understand ,because functions like rtIOStreamRecv etc were used apart from functions like

    sciRxError in Normal sci.h callbacks

    This rtIOStreamRecv etc is defined in TI_RM48HDKSerialRtiostream-Rtiostream.c   .

    Now I want to know how to include this .c file  with its .h file (TI_RM48HDKSerialRtiostream-Rtiostream.h   ) in the project.

    Is my understanding up till here correct if not suggest the necessary steps to be taken

    if here I would get a understanding of what necessry files to include and what necessry changes to be done i think i can make this.

    Expecting your solution in anticipation,sorry for troubling you by long script.

     

    Regards

    P.Wesley

     

     

  • Hi Wesley,

    Wesley Barnabas said:
    I followed the steps for Halcogen so I enabled SCI 1 only - from driver enable tab.(for i want serial communication )

    Then I generated the code .

    So far so good.  But to confirm, is the HalCoGen project that you started with:

    • a) a new project, where you selected TMDX570LS20SUSB from the HalCoGen new project gui?
    • b) opened the project that is included in the hercules PIL package folder.

    It needs to be a) not b.

    TI_HerculesRtiostreamTest

    Wesley Barnabas said:
    Then opened CCS and created a project with same name

    Likewise when you created your CCS project did you specify a TMS570LS20206 or appropriate target?
    If you don't do this you might not get the right build settings in the CCS project.

    Wesley Barnabas said:
    This hooks all Halcogen files created (sources and includes into project) with .dil and .hcg

      Not quite.  The CCS builder seems to find all of the source files in any sub-folders of the project for you automatically.   But you need to add the include folders manually to the project.  Probably you forgot this then and are getting errors about not finding header files??

    Wesley Barnabas said:
    Then I opened sys_main file and copied contents of TI_HerculesRtiostreamTest.c file to it to make it a main file

    Ok on this point sorry it's my mistake.   Actually I tested by adding a call to TI_HerculesRtiostreamTest() to the empty main function in sys_main.   I didn't replace the contents of sys_main like the examples show but otherwise the idea is the same as the examples.

    Wesley Barnabas said:
    here is were I failed to understand ,because functions like rtIOStreamRecv etc were used apart from functions like

    sciRxError in Normal sci.h callbacks

    This rtIOStreamRecv etc is defined in TI_RM48HDKSerialRtiostream-Rtiostream.c

    The rtIOStreamOpen calls sciInit() from halcogen.  You might see this done in the main routine of the halcogen examples but here we defer until we the open function is called.

    And rtIOStreamRecv calls rtIOStreamSciRecv which in turn uses the HalCoGen headers and definitions to work w. the SCI.  It's not actually calling a HalCoGen function - sorry I can't remember exactly why this is.

    However on the send side the halcogen function sciSendByte is used.

    Wesley Barnabas said:
    Now I want to know how to include this .c file  with its .h file (TI_RM48HDKSerialRtiostream-Rtiostream.h   ) in the project.

    Same answer as above.  the .C and .asm files should be automatically found by CCS and you if you have to exclude one for some reason there is an extra step.  On the other hand header files are not found and you have to do an extra step to include them.

    The extra step to include the headers is to add the path to them in the project build properties.

    If you right clock on your project and open properties, you can find under the "Build->ARM Compiler->Include Options" tab a box called 'Add dir to #include search path  (--include_path, -I).  Just select the + button and add each folder to the include path.  If you make a mistake (I always do this by clicking too soon in the browser that pops up) you can delete and start over or you can use the pencil icon to edit the path.  Try to use workspace or project relative paths if possible. 

    You can have multiple lines in this box, one for each folder where there are .h files.  So the HalCoGen include files and the rtiostream include files are likely in separate folders and you will need each folder added to this list separately.

    Anyway let me know how this goes and thanks for your patience trying this out for the first time.

    EDIT: One comment I didn't check whether it is SCI1 or SCI2 for the LS20206 USB stick since it seemed like you're not yet able to build the test case.  But this might be the thing that you need ot check next if you are able to build. 


    The SCI # to use is board dependent you have to check the schematic for the board and see which SCI is hooked up to the FTDI USB chip as a UART - this is the one that you can get to over the USB port as a virtual com port.

    If it is a different SCI than what is in the rtiostream files then you will have to change which sci is pointed to by the pointer 'scilinREG' in addition to changing the sci settings in the halcogen gui.

    I believe you only need to change this in the places it is used in rtIOStreamSend and rtIOStreamRecv since the sci port # is then passed to the lower level functions as a parameter.

    Also make sure your clock frequencies and SCI baud rates are adjusted for the USB board...

  • Hi Anthony,

    I was able to make a project and include files as suggested ,and I was sucessful in .out file also.

    Now I need to test it as standalone as normal loopback.

    If any issues arises,I shall share the code for your perusal.

    Thanks for the steps in detail shared.

    Regards

    P.Wesley

  • Hi Anthony

    When I enter debug mode sucessfully and hit the green run arrow I end up with this message

    Can't find a source file at "/tmp/TI_MKLIBaWhlp2/SRC/exit.c"
    Locate the file or edit the source lookup path to include its location.

    What could be the cause of this ?

    Could you share your email ID so that i will send code If Im not able to resolve.

     

    Regards

    P.Wesley

  • Wesley,

    The source file exit.c comes with the runtime library.  I think the reason it is looking in a temp folder is that probably the library had to be built the first time you compiled a project, and that's the temp folder where the lib was unpacked and compiled.

    Anyway you don't need the source - it just is has a branch-self loop in it.  exit.c is something that is called after you leave main() to clean up the env and not generally important for PIL.

    Normally the loopback test doesn't exit - but if there is an RTIOSTREAM_ERROR returned then it will exit the otherwise infinite loop:

    	do {
    		streamStatus = rtIOStreamRecv(streamId, rtiostream_dst, size, &sizeRecv);
    		rtiostream_src[0] = rtiostream_dst[0];
    		streamStatus = rtIOStreamSend(streamId, rtiostream_src, size, &sizeSent);
    	} while(streamStatus != RTIOSTREAM_ERROR);

    When the above code exits then you will go back to main(), main will exit and you'll hit exit.c.  But you don't want this to happen anyway - you want to get to the point where the loopback works without returning an error.

    So I think either the send or receive function returned RTIOSTREAM_ERROR which could be one of the error flags in the SCI getting set.  The next step is to find out why - you can step through or set breakpoints in the send/receive functions to figure out why the error is being set.  It might tie back to an error flag in the hardware - and if it is something like a framing error in the SCI this could be as simple as not having the baud rate set correctly on the PC's terminal program.

  • Hi Anthony

    Thanks for your support 

    I was able to assemble all that is required to build the project and was able to make the .out file with some warnings like

    Description Resource Path Location Type
    #551-D variable "scilinREG" is used before its value is set      TI_RM48HDKSerialRtiostream-Rtiostream.c /MySCI line 118 C/C++ Problem

    I have flashed the .out file on the TMS570LS20216SPGE (in which I was sucessfull wih Ti  examples) when I go in Debug mode and hit run(green) ,and enable my terminal(inbuilt by Ti) for veiwing what I type in keyboard the SCI 1(I have enabled SCI 1) LED is blinking for every keystroke but Im not able to get back what I type on keyboard in the terminal screen

    what can be the all possible solutions for this so I can veiw also the keystrokes

     

     

  • Hi Anthony

    As you suggested i kept breakpoints and debugged exactly as you pointed in our previous post it went into errror and exit.c and with that exit error it came out.

    After this as per your reply I tried changing the baud rate but still I failed execution.

    But if I type in keyboard any key , SCI 1 led (blue) blinks,it means what?

    Actually when debugging from main function  it went into

    streamStatus = rtIOStreamRecv(streamId, rtiostream_dst, size, &sizeRecv);

    Here "streamId" should be 1,but Im getting 8803 or so so it is going to error mode.

    Please suggest me what shall I do to get this loopback working.

    Suppose if I want to share this code to you how shall I do it.

    Regards

    P.Wesley

     

     

     

     

  • Wesley,

    If you want me to look at your loopback test no problem.  You can post the project here.

    streamID is something you pass as a parameter to rtIOStreamRecv.   It should be 1 you're right.

    streamID is returned by the call to rtIOStreamOpen().   Did this function actually return 8803 instead of 1?

    If so then understanding how/why might be one part of the puzzle.   Especially since that function is pretty much
     hard-coded to return a value of '1'.

  • Hi Anthony,

    I have attached the loopback project which you can have a look and check2330.MySCI.zip  .

    Regards

    P.Wesley

  • Hi Anthony

    Thanks for your support  and patience in giving solutions.

    Now I have got some good hold of basics of Halcogen 4.0

    I was able to run some good projects enlisted in Ti help Pdfs.Like blink,SCI,ADC etc.

    I have also sent you the loopback code for your perusal ,please have a look and do changes where necessry.

    So I want to excute that also (To test loopback code(standalone) from your PIL package)

    Though I have tested looback through Ti examples and tested the board for SCI etc,I want to test the same through this code(from your PIL package) also.

     Awaiting for the code from yourside with changes made if my reasoning  on code is wrong.

    The main activity - PIL implementation

    I have started reading your PIL setup files(from PIL RM48 package) for PIL implementation on the TMS 570 LS stick board

    I found that the rtw folder is not included in package,please give the possible solution for this.

    Expecting reply in anticipation.

    Regards

    P.Wesley

     

     

     

  • Hi Anthony

    I want to know where and when and why does the rtwTargetInfo.m script is called in the PIL package.

     

    Regards

    P.Wesley

     

  • Hi Anthony or any Ti employee related to PIL

    Please I want to know about the rtw folder which is missing in the RM48 PIL package.

    Please share me the rtw folder and other related information ,for I m working very seriously in excuting the PIL package to sucess in TMS 570 USB.

     

    Regards

    P.Wesley

  • Hi Wesley,

    There isn't anything in the rtw folder and if it is included in the .zip file it should be empty.   It's not used by this PIL pacakge.

  • Hi Anthony

    Thanks for the reply

    Regards

    P.Wesley

  • Hi Anthony,& Ti Team

    Thanks for your support  and patience in answering my queries regarding PIL.

    I need  information regarding constant Ti Tech support for the various Ti products which we handle in our Lab can you kindly help us by giving the right contact .

    For eg:- CCS Complier etc

    Expecting your reply with anticipation.

    Regards

    P.wesley

     

  • Wesley,

    For TMS570 PIL this is the correct forum.  Also for TMS570 silicon post here.

    For compiler and CCS questions there are dedicated E2E forums.  You probably need to use some judgement as to which forum to post to - if the question is fairly independent of the silicon (ie. mechanics of using the tool,  for example how to make the linker put sections where you want them, or how to script something in CCS) then these questions go best on the tools forum versus this forum.  If it's something like flash programming of the TMS570 then this is the best place to post first, because the silicon is strongly tied.   

    Of course if you post here and it's best answered by the team monitoring the CCS forum - we'll move your post so the right people see it - but this takes some extra time so if you can hit the right forum first it's faster for you.  But don't worry too much about it otherwise.

  • Hi Antony and Ti team,

    Thanks for the information shared regarding Ti Tech Support.

    Again I m back with some TMS 570 PIL queries ,Please kindly help me .

    Im in the verge of downloading the code in 570 Target.I was sucessfully able to run PIL codes ie setup & main m scripts  from the package to create PIL.

    Below is the verbose which I was able to view in Command Window in MATLAB.

     

    ### Successfully updated the model reference SIM target for model: ex1_fir_mdl (name of Referenced model used in my simulation)

    ### Starting build procedure for model: ex1_fir_mdl

    ### Successful completion of build procedure for model: ex1_fir_mdl

    ### Connectivity configuration for referenced model "ex1_fir_mdl": RM48 HDK PIL Package

    ### ### Preparing to start PIL simulation ...

    Building with 'lcc-win32'. MEX completed successfully.

    ### Starting application: slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out Begin communication with RM48 Launching loadti to download C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out

    Launcher command string: C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\utils\loader\loadti

    Launcher command arguments: D:\CCSv5\ccsv5\ccs_base\DebugServer C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\utils\loader -r -a -c "C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\src\TMS_570\TI_RM48HDK.ccxml" -x "C:\Users\p.b\AppData\Local\Temp\tpac06ba98_4996_4e21_ad50_9de117dcec78_loadti_log.xml" "C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out" *****

    DSS Generic Loader *****

    START: 16:15:37 GMT+0530 (IST)

    Configuring Debug Server for specified target...

    Done

    TARGET: Texas Instruments XDS100v2 USB Emulator_0

    Connecting to target... CortexR4: GEL Output:  Memory Map Setup for Flash @ Address 0x0 Resetting target...

    testEnv.outFiles: C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out

    Loading C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out

    NOTE:

    It stops here with the Target LED for JTAG blinking for long time so I m unpluging and pluging the target every time and I get the below error when (Ctrl-C) has been detected.

    Error due to multiple causes.

    Caused by:     Error in 'ex1_fir_mdl_tb/TmpSFcnForModelReference_ex1_fir_mdl' while executing C MEX S-function 'ex1_fir_mdl_psf', (mdlStart), at time 0.0.        

    Program interruption (Ctrl-C) has been detected.    

    Error in 'ex1_fir_mdl_tb/TmpSFcnForModelReference_ex1_fir_mdl' while executing C MEX S-function 'ex1_fir_mdl_psf', (mdlTerminate), at time 0.0.        

    An error occurred while calling into the SIL or PIL target connectivity implementation.

    Communications error: the communication channel may not be properly shut down.

     

    Questions:

    1) I want to know what is the line in verbose after " ### ### Preparing to start PIL simulation ... "

    Building with 'lcc-win32'. MEX completed successfully mean?

    What does lcc.. do here?

     

    2) When it reaches the verbose" Loading C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48 slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out" in Command Window ,TMS 570 USB LED blinks ie JTAG,but it is not progressing to Done (ie next verbose) I like to know what would be all possible solutions for this cause?

     

    3) Since Im using  Ti 570 can I use the RM48 ccxml file given in the package?

     

    4) Can I use the same Halcogen file and c and h files of drivers for Ti 570?

     

    5) Can I use the same loadti file provided in the RM48 package?

     

    6)Apart from the queries raised if you find any information to be shared please share it.

     

    Expecting reply in anticipation since I working on it very closely & seriously.

     

    Regards,

    P.Wesley

     

     

     

     

     

     

     

     

  • Hi Anthony ,

    I had raised  query regarding some issuses faced duing devoloping PIL in TMS 570 in previous mail.

    please kindly share with me possible solutions ,so they could be helpful for me , since I'm stuck midway .

    Expecting a quick reply from you or Ti Team in anticipation.

     

    Regards

    P.Wesley

  • Wesley,

    Wesley Barnabas said:
    Questions:

    1) I want to know what is the line in verbose after " ### ### Preparing to start PIL simulation ... "

    Building with 'lcc-win32'. MEX completed successfully mean?

    What does lcc.. do here?

    I think some code is also compiled on the host PC side for communications - I've always seen a .mex file generated for the host side and the .out file generated for the target.   But I can't say for sure if the 'lcc-win32' build that you mention is the same.  What folder is it working in?  I always see the mex files generated in the same folder as the model but the .out is in a subdirectory under slprj...

    If there is a question here you could post your slprj folder perhaps or a listing of it's contents and we can see if it looks right...

    Wesley Barnabas said:
    2) When it reaches the verbose" Loading C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48 slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out" in Command Window ,TMS 570 USB LED blinks ie JTAG,but it is not progressing to Done (ie next verbose) I like to know what would be all possible solutions for this cause?

    I put a heart-beat function to blink the LED on the HDK & the control card - one of the 'user' LEDs tied to a GIO or HET pins.   This is what I used to determine if the send/receive loop was running i.e. if the board was up and ready to talk to Simulink over UART.  You can change this code to match an IO pin that goes to an LED (other than one of the JTAG LEDs which just indicate activity) and use it for the same purpose.  I don't know the USB stick well enough to make a recommendation on which LED off hand but should be easy enough to find -- and if there is a blinky project then you could use the same LED as used in the blinky project.   

    Wesley Barnabas said:
      3) Since Im using  Ti 570 can I use the RM48 ccxml file given in the package?

     

    This might seem to work but you should really not do this.  Just use CCS to generate the correct CCXML file for the USB stick and change the TCONF value to point to it.  I believe there is some documentation on how to do this in the 'Making Customizations' section of the online help for the RM48 PIL package.

     

    Wesley Barnabas said:
    4) Can I use the same Halcogen file and c and h files of drivers for Ti 570?

    No not at all.  Please see the help file TI_HERCULES_RM48/doc/html/ug/making_customizations.html and the section "Customizing the Device Initialization Code".   This explains step by step how to use HalCoGen drivers generated for a different part.   You need to do this because the initialization code and driver code is different.   Warning: going back to the older LS20216 on your USB stick there may also be API differences that you might need to work through.  But if you got through the rtIOStream loopback testing then you would have gotten through most of these differences.

    Wesley Barnabas said:
    5) Can I use the same loadti file provided in the RM48 package?

    Without having tried it I would say yes.  The LoadTI script that comes with the RM48 PIL package is almost the same script that comes with CCS and that supports all TI parts.  The change that I made was to workaround an issue

    Wesley Barnabas said:

    6)Apart from the queries raised if you find any information to be shared please share it.

    You might want to see "Targetting a TMS570 Series Hercules Device" in the same help file...  it was really written for the newer TMS570 devices ... the LS3137 series is a replacement for the LS20216 and so that's why I didn't consider the LS20216.  But most of what is in this section applies, if there are differences (I don't know) I'd expect them to be in the HalCoGen APIs since I think there are still some differences in code for the older and newer generation parts.   Sorry I can't tell you what these would be - but I'd be most concerned that the rtIOStream might need some adjusting in the way it calls the sci / lin API functions.  

  • Hi Anthony and Ti

    Thanks for the reply and patience in answering my queries

    If any I shall come back again

    Regards

    P.Wesley

     

     

  • Hi Anthony ,

    Thanks for your timely support and patience in replying my  queries .

    I was able to execute a PIL in TMS 570 successfully.

    If need be I shall come again.

    Regards,

    P.Wesley

  • Hi Anthony

    Once again Thanks for the support so far shared with us.

    I need only 1 clarification from you.

    When my PIL model is executing on the target for suppose 0.05 set in simulation stop time once it reaches 0.05 I get an error message in my Command window

    How to overcome this,ie my model executes for 0.05 only,and I should not get the error message in my CW in MATLAB.

    ===========================================================

    Execution starts once the script is run and below are the verbose in CW

    ===========================================================

    ### Successfully updated the model reference SIM target for model: ex1_fir_mdl

    ### Starting build procedure for model: ex1_fir_mdl

    ### Successful completion of build procedure for model: ex1_fir_mdl

    ### Connectivity configuration for referenced model "ex1_fir_mdl": TMS 570 PIL Package

    ### ### Preparing to start PIL simulation ...

    Building with 'lcc-win32'. MEX completed successfully.

    ### Starting application: slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out Begin communication with RM48 Launching loadti to download C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\examples\slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out

    Launcher command string: C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\utils\loader\loadti

    Launcher command arguments: D:\CCSv5\ccsv5\ccs_base\DebugServer

    C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\utils\loader -r -a -c "C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\src\TMS_570\TMS570LS20216SPGE.ccxml" -x "C:\Users\p.b\AppData\Local\Temp\tpcdf822d3_8b6a_496e_99c2_e881e98d8c39_loadti_log.xml" "C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\examples\slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out"

    ***** DSS Generic Loader *****

    START: 11:37:52 GMT+0530 (IST)

    Configuring Debug Server for specified target...

    Done

    TARGET: Texas Instruments XDS100v2 USB Emulator

    Connecting to target... CortexR4: GEL Output:  Memory Map Setup for Flash @ Address 0x0

    Resetting target...

    testEnv.outFiles: C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\examples\slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out

    Loading C:\Users\p.b\Desktop\TI_HERCULES_RM48\TI_HERCULES_RM48\examples\slprj\ert\ex1_fir_mdl\pil\ex1_fir_mdl.out Done

    Target running... END:

    11:38:13 GMT+0530 (IST)

    Pausing 3 Seconds

    after 0.05 and sucessfull execution I get the below error message in CW in MATLAB

    ===========================================================

    The error message in CW is

    ===========================================================

     The timeout of 60 seconds for receiving data from the rtiostream interface has been exceeded. There might be multiple reasons for this failure. You should:

     (a) Check that the target hardware configuration is correct, for example, check that the  byte ordering is correct.  (b) Confirm that the target is running.  (c) Consider the possibility of application run-time failures (e.g. divide by zero  exceptions, incorrect custom code integration, etc.).

    If you cannot find a solution, consider using the method setTimeoutRecvSecs of rtw.connectivity.RtIOStreamHostCommunicator to increase the timeout value.

    Expecting reply in anticipation so I could fix them.

     

    Regards,

    P.Wesley

     

     

     

  • Hi Wesley,

    Are you using 2014a?  Mathworks reported something similar to me in 2014a and it's resolved by commenting out the SCIInit() function in the rtIOStream close function - but I haven't tried this out yet myself. 

  • Hi Anthony,

    It worked.Thanks for your prompt reply ,by which I was able to solve the raised query.

    The MCU used is TMS570LS20216SPGE .

    Suppose say I have a proprietary board (ECU) in which I have TMS570 MCU,but no JTAG ,Emulator .

    To solve the JTAG and Emulator issue ,can I buy external from Ti ?

    Will the same PIL settings which worked for the Ti board with TMS570LS20216SPGE ,work for the proprietary board.

    What are the other areas I need to concentrate when Im using proprietary board.

     

    Regards

    P.Wesley

     

     

  • Wesley,

    Super.  If you have a custom board then you need 2 things.  The JTAG emulator is one.  You can actually get the schematics for the XDS100v2 and build your own or buy it from multiple sources and then you will be able to use the same .CCXML file.  But you could just as easily switch to a faster emulator like the XDS200 or XDS560v2 and just change the CCXML file that is used by PIL.  Just change that TCONF parameter to point to the right file for your emulator as described in the help.

    Now, what is different with a standalone board is that you will also need a UART connection.  The on-board XDS010v2 includes a UART channel but there is no UART channel on a standard 14 pin or 20 pin TI JTAG header.  So you will need to figure out how to get a UART connection to your board, and you may need to adjust the HalCoGen files for the UART if it is a different SCI or if you need to run at a different baud rate.   There are config parameters for the UART port # and baud rate in the Matlab envioronment that you can change to match if you need to.  Of course the more you can match your current setup - the less you have to change.  But there isn't anything too difficult involved in just changing the emulator / COM port.

    The only caution I would give is to stay away from older emulators like the XDS510 class if you can.  You should at least use an XDS100v2 or an XDS200 instead as they are better supported in the current versions of CCS.  You can see on this forum that the 510 class has been a source of problems and isn't being maintained anymore.

  • Hi Anthony

    Once again thanks for your reply

    As suggested I saw some solutions in Ti wiki for XDS100,and found 2 soutions related to the UART.

    So please suggest me if I get Ti XDS100 will my query related to UART solved.

    Below are the 2 from wiki XDS100:-

    1) Q: Can I use port B as a UART?

    • A: Yes. The TI XDS100v2 reference design uses the port A of the FTDI2232H to be for JTAG. This leaves the port B available for use either to program the CPLD and/or for use as a UART. The XDS100v2 design puts the CPLD JTAG programming on a selected number of pins (see XDS100v2 readme for details). This allows the CPLD to be programmed via the FTDI device, greatly simplifying manufacturing.
    • Please note that there is a known issue with the current XDS100v2 reference design with the placement of the BCBUS. If you plan to use the port B, please check the readme of the XDS100v2 reference design for details. Generally, a serial port on BCBUS should connect the CPLD as follows: BCBUS1 -> CPLD TCK, BCBUS2 -> CPLD TDI, BCBUS5 -> CPLD TDO, BCBUS6 -> CPLD TMS.
    • Please note that using UART mode simultaneously with Code Composer Studio v4 has NOT been tested on the XDS100v2 design and is not officially supported. Experience with C2000 ControlCards which implement this functionality indicate the FTDI driver can handle such an interaction. *The C2000 control card does implement a serial port simultaneous with JTAG, but it is done with an XDS100v1 design. There is a thread on the forum at [1]. The FTDI driver gives each half of the FTDI chip a seperate USB handle and USB endpoint, so they are essentially independent. The FTDI supplied software is the software that is needed to get this support; there is no TI specific software needed for this support.

    2) How can I use the XDS100v2's second port as a serial port (UART)?

    • A: Ensure that there is a physical connection between the FTDI Port B TX and RX pins and your target serial device and then follow these steps:
    1. Click Start, Right click on My Computer, and select Properties
    2. Navigate to the Hardware tab of the System Properties dialog box and select Device Manager
    3. In the list of devices, expand the group titled Universal Serial Bus controllers and look for a device named TI XDS100 Channel B
    4. Right click on this device and select Properties
    5. On the Advanced tab of this dialog box, ensure that the box labeled "Load VCP" (virtual COM port) is checked. Click OK when you are done.
    6. Unplug and replug the XDS100v2
    7. After the XDS100V2 has been re-connected, look for a group called Ports (COM & LPT) in Device Manager. Expand this group and look for an entry labaled USB Serial Port (COMXXX).
    8. The COM number associated with this port is the one you want to use in Hyperterminal, PuTTy, or your favorite terminal application.

     

    First I like to solve this and move to Halcogen

     

    Regards,

    P.Wesley

     

     

  • Wesley,

    These comments are correct however they mainly apply to the XDS100v2 when it is embedded on a board.

    If you buy a standalone XDS100v2  with a 14 or 20 pin JTAG header, the header doesn't have any pins for UART functionality.  So the functionality of the FTDI chip is 'locked up' on the emulator and there is no standard way to make the physical wire connection to the target.


    Of course the XDS100v2 design is open and you could certainly make a layout that routed JTAG to one header and UART to another, and as long as your custom board has the matching headers you would be OK.  Or you could just design the XDS100v2 circuit onto your kit and wire up the UART like we do on the HDK, launchpad, etc.

  • Hi Anthony,

    Thanks for the solution,Im working on it.

    I want an imminent support by kindly answering me the below queries.

    1. Suppose say I have already auto generated code for a model . Is it possible to do PIL with this.?

        what are the challenges?

    2.I ran the PIL successfully with MATLAB 2014a.Can I take the same model and run it with lower versions ?

      Till what versions it will be supported? what are the challenges?

      

      Expecting an reply with anticipation for Im attempting for an work around if possible.

     

    Regards

    P.Wesley

     

     

     

  • Wesley,

    1.  I don't think so - but I guess the question would be why would there be an issue recompiling the model in this case?

    2. R2013B I think.  Below that I am not sure that the toolchain registry method works and you would need to switch to using a manual makefile (.tmf file) for the build.  Check the manuals for the toolchain registry feature though - it should be the first thing to 'break' if you go back to prior versions so that will give you an idea how far you can go without making additional changes. 

  • Hi Anthony,

    Thanks for the update on the queries.

    Regarding the 1 st query ,I would state it like this.

    We have as of now the Model as the input,but if I have already auto generated code ,can I take the generated code as input and then proceed with PIL instead of the Model from the start of the process,and what challenges would be there.

    Expecting reply in anticipation.

    Regards

    P.Wesley

  • Hi Wesley,

    I'd have to say I don't know about this - I haven't really considered it because code generation has never been a time consuming step.   This might be a good query for the mathworks instead.  I am sure I don't have the depth of experience that you have w. the problems of real world model generation - we only have worked 'examples'.

    -Anthony

  • Hi Anthony,

    Thanks for update and I got it, but I shall still put my query like this ...

    I have a model ,and autogenerated C code from the model for some Target xxx.

    Now can I take the autogenerated code and do the PIL testing instead of the model.

    For this do we need to wrapper the autogenerated C code and then do PIL,will this work?

    If we need to wrapper or take this process forward how you can help me to make this success.

     

    Regards

    P.Wesley

  • Hi Wesley,

    There might be a way to do that by making a block that maps to the pre-generated C code;  I haven't tried this before.
    You might check into the concepts of s-functions for code generation and/or shoot that question to Mathworks.

    I'm not sure if you would get a good breakdown of profiling data this way though - so that may be one thing to consider if you are after timing.  You might only get the timing for the entire code ... something to consider and ask about.

  • Hi Wesley,

    I am trying to run a PIL simulation in Matlab Simulink with an TI Experimenter Kit F28335. However, I receive the same TIMEOUT problem as you described above. I have tried to find the SCIInit() function in the rtiostrem close function. Unfortunately, I have not found it. How did you make it work? can you please give me an hint?

    I use Matlab 2016a, CCS v5.

    Thanks in advance.
    Best Regards,
    Trung