Author Topic: General simulator problems  (Read 7043 times)

Offline k64konfused

  • Newbie
  • *
  • Posts: 25
    • View Profile
General simulator problems
« on: September 25, 2014, 03:14:47 PM »
I'm going through the uTasker - Kinetis Tutorial and felt that it makes the most sense to familiarize myself with uTasker using the simulator first, and then move on to real hardware (FRDM-K64F).

I have made the necessary modifications to the Simulator project using VS2010.  I have set my simulation UART0 to COM9, and have set my network settings as described in the manual (only modified for my particular network).  The project compiles and runs just fine.

The problem I see is that *nothing* in the menus work.  I started by selecting LAN -> Select Working NIC, and nothing happens.  I then tried UARTs -> Simulate a receive message on UART0.  I created UART0.txt in my Debug folder, but nothing gets read from the file as far as I can tell.  So I tried *all* of the other menu commands, and nothing happens.  It's also strange that in my application window, the IP says x.x.x.x:yy-yy-yy-yy-yy-yy instead of having a real IP and MAC address.

Furthermore, the first three times I ran the application, the board was a green PCB, but now it looks like an actual FRDM-K64F.  I haven't changed *anything* other than what I have already described.

Does anyone know what I'm doing wrong here?

Offline k64konfused

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: General simulator problems
« Reply #1 on: September 25, 2014, 03:16:20 PM »
I take one statement back -- Port Sim -> Open Script presents a file open dialog.  Help -> Info and File -> Exit work as well.  :)

Offline k64konfused

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: General simulator problems
« Reply #2 on: September 25, 2014, 03:22:06 PM »
Ok, I've figured out the NIC part.  I happened to find a commented-out ETH_INTERFACE #define, which was not documented in the manual.  Uncommented and now ethernet seems to be enabled.  I'll keep playing around.

This leaves the UART functionality with a ? still.  Can anyone explain how that's supposed to work?  From other posts, I've gathered that I have to create the UART0.txt file to simulate the input on COM9 (which doesn't actually physically exist on my computer -- is this a problem as well?) and then the app will read it in.  I assumed that not having a physical port corresponding to COM9 is okay, since this is a simulation of data receiving only.

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: General simulator problems
« Reply #3 on: September 25, 2014, 06:10:45 PM »
Hi

Kinetis V1.4.7 was released with ETH_INTERFACE disabled (see release notes) so it is correct that it needed to be enabled to use Ethernet and for the simukator to work with the NIC.
Note however that this is not (really) a mistake because config.h can be configured in many different ways and will often be changed many times a day as different parts and applications are worked on. Therefore always check that the project setup is as you would like it to be - the simulator helps to do this quickly.

UARTs:
- if you set up a UART to be mapped to a COM port that exists on your PC it will communicate via that physical interface.
- What is often used is a COM to COM loop back device so that a PC application, like a terminal emulator , can be connected to the UART. See this thread for details: http://www.utasker.com/forum/index.php?topic=673.0
- UARTx.txt is created (if enabled) to save all transmitted data into so that it can be analysed (if required) after simulator use. It in not an input to the simulator but instead just a log file.
- The UART tests in the menu allow the simulator to inject a simple test reception to the UART in question (it just sends a fixed string like "Hello, world". It is usefuly for checking the basic reception - for example by putting a breakpoint into the UART rx interrupt to see whether it is hit when the test is executed and then to check the application level reception to see that it arrives there correctly.
- It is also possible to write a simulator script file that includes data to be injected into the UART(s) (this is started using the "Port sim" menu) and is especially useful if you are developing protocols and you want to inject test messages/sequences to test/develop the application layer handling.
Eg.
500 UART1 "TEST_RX_1"
+1000 UART1 "Next test"

This would inject the string TEST_RX_1 to UART 1's input after 500ms and then inject teh second string 1000ms later.
0x00 0x02 0x03 etc. can be used instead of strings to inject binary data.

Regards

Mark