Author Topic: SAM7X SP4  (Read 12302 times)

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2940
    • View Profile
    • uTasker
SAM7X SP4
« on: December 29, 2008, 10:56:32 PM »
Hi All

This is a pre-announcement concerning an upcoming service pack for the SAM7X. The service pack should be released within the next few days after final testing.

The following new features are included -
SAM7X specific:
- port interrupt support on all GPIOs to allow selectable edge triggering and individual handlers per port
- DBGU support in interrupt and DMA modes
- USB support including simulation - see the new demo document: http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF
- Improved PLL configuration
- Keil and IAR5.2 projects added
- ADC support allowing DMA sampling to user defined buffer without CPU intervention, plus automatic high/low and zero-crossing triggers. ADC simulation support.

General:
- Various corrections and improvements (full details will be included in the SP release notes)
- HTTP plain text post support
- Improved script simulation support
- HTTP dynamic content improvements and demos
- HTTP Chrome support
- New ST and SST SPI FLASH support

Various additions are the result of real project experiences during the last year, so, even when not always spectacular, should result in improved user experience and stability.

Of course the main new feature is the USB support. OLIMEX SAM7X-EX256 owners can already give this a try as follows:

- Download the following demo pack: http://www.uTasker.com/Demos/SAM7X/SAM7X_USB_DEMO_OLIMEX_V1.3.4.0.zip
- Load the file uTaskerV1.3_sam7X_USB_demo.bin to your Olimex board using SAMBA (or similar)
- Follow the demo document http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF (the USB .INF file is also included in the demo pack: uTaskerVirtualCOM.inf) [Note that the serial connection used is the DBGU interface, operating in DMA mode for transmission, so ensure that the jumpers for DRXD and DTXD are set accordingly and connect to the RS232 connector with a straight 9-pin connector]
- When testing software uploads via USB simply use the files z_Upload_V10.bin and z_Upload_V11.bin. These simply have different version numbers which are displayed and so confirm upload success.

Note that the project also contains the standard Ethernet stuff and the web pages can be copied to the board by executing Copy_all.bat (check that ftp.txt contain the correct IP address of the board). The default IP address is 192.168.0.3 but this can also be changed via the USB menu if unsuitable for your network. In fact the software upload can also be performed via Ethernet by copying the new code via FTP and resetting, or by sending it via HTTP post on the "admin" page of the web server.

I believe that this service pack and its new features represent an important contribution to the versatility of the project and its acceptance for use in an increasing number of projects. Good luck with your tests and I look forward to the final release in the next few days!!!


Regards

Mark

« Last Edit: December 29, 2008, 11:49:15 PM by mark »

Offline itchyfigers

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: SAM7X SP4
« Reply #1 on: December 30, 2008, 05:01:52 PM »
Mark this is awesome news, I am very excited about SP4.  Keep up the good work!

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2940
    • View Profile
    • uTasker
Re: SAM7X SP4
« Reply #2 on: December 31, 2008, 08:53:13 PM »
Hi All

Just in time for the new year, the SP4 has been released. It can be downloaded from the service pack page: http://www.utasker.com/software/softwareV1.3.html

Hope you enjoy it and have fun!!

Regards

Mark


P.S. Please note a few small details to avoid any starting difficulties:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Notes concerning using the new SP:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

1. Use the file \Applications\uTaskerV1.3\config-sam7x-reference-SP4.h as configuration reference. This was used for testing the release and can be renamed to config.h if you would like to use it as a base for new work, rather than modifying the original config.h.

2. When compiling the new project the first time in the simulator environment there may be an error due to a missing define. Don't panic, since this happens due to the fact that VS automatically generates a local file which is not fully suitable for the project based on the fact that that new resources (menus etc.) are present.
Simply delete the file \Applications\uTaskerV1.3\Simulator\resource.h and recompile. This time it will work correctly and the problem will also not repeat in the future.

3. GNU project includes a new make file with usb sources added: make_uTaskerV1.3_GNU_SAM7X

4. Original IAR4 and Rowley projects have not been updated in this servcie pack. To use these with USB simply add the new files to the project as follows:
- uTasker\USB_drv.c to the uTasker folder
- usb_application.c to the application folder
- Optionally add uTasker\usb.h to any header folder

5. Please visit the uTasker SAM7X forum at http://www.utasker.com/forum/index.php?board=4.0 to monitor any patches added to this release and also for instructions as to how to use some of the new features.

6. Since the main new feature of the SP is the USB support a new demo document has been prepared which gives a quick and practical introduction. It is recommended to start with this: http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF where extra details can also be followed here:
http://www.utasker.com/forum/index.php?topic=478.0

« Last Edit: December 31, 2008, 08:57:28 PM by mark »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2940
    • View Profile
    • uTasker
Re: SAM7X SP4
« Reply #3 on: January 03, 2009, 11:18:50 PM »
Hi All

A new demo pack has been added for owners of the ATMEL AT91SAM7X-EK board.

- Download the following demo pack: http://www.uTasker.com/Demos/SAM7X/SAM7X_USB_DEMO_AT91SAM7X-EK_V1.3.4.0.zip
- Load the file uTaskerV1.3_AT91SAM7X-EK_USB_demo.bin to your ATMEL board using SAMBA (or similar)
- Follow the demo document http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF (the USB .INF file is also included in the demo pack: uTaskerVirtualCOM.inf) [Note that the serial connection used is the DBGU interface, operating in DMA mode for transmission, so connect to the RS232 connector "SERIAL DEBUG PORT" with a cross-over 9-pin connector]
- When testing software uploads via USB simply use the files z_Upload_V10_EK.bin and z_Upload_V11_EK.bin. These simply have different version numbers which are displayed and so confirm upload success.

Note that the project also contains the standard Ethernet stuff and the web pages can be copied to the board by executing Copy_all.bat (check that ftp.txt contain the correct IP address of the board). The default IP address is 192.168.0.3 but this can also be changed via the USB menu if unsuitable for your network. In fact the software upload can also be performed via Ethernet by copying the new code via FTP and resetting, or by sending it via HTTP post on the "admin" page of the web server.

Good luck!

Regards

Mark




Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2940
    • View Profile
    • uTasker
Re: SAM7X SP4
« Reply #4 on: January 06, 2009, 12:12:37 PM »
Hi All

Here is the SP4 patch list:

1) To build with GCC to corrections are require in SAM7X.c as detailed in the following: http://www.utasker.com/forum/index.php?topic=484.0

2) The simulation file for testing endpoint1 (as detailed in the USB tutorial) is not included in the SP4 files.
If you want to test this simply copy the following to a file called ep1_data_test.sim and open it from the "Port Sim" menu

// USB endpoint 1 data reception

+0 USB-1    = "Hello, World!!" 0d 0a
+100 USB-1  = 0a
+100 USB-1  = 0a
+100 USB-1  = 0a
+200 USB-1  = 0a
+500 USB-1  = 0a
+1000 USB-1 = 0a
+1000 USB-1 = "Did you like the test?"  0d 0a
// End of test


3) In the new IAR5 project there are 2 additional file which are not yet in the project. These will not be found when compiling so please remove the MODBUS folder from the project (in the workspace window - click on MODBUS folder and Right mouse click and "remove") so that the project builds successfully.

4) The SP4 doesn't include new bat files which allow automatic loading of web pages via FTP. These can however be downloaded from the USB demo pack here: http://www.uTasker.com/Demos/SAM7X/SAM7X_USB_DEMO_AT91SAM7X-EK_V1.3.4.0.zip

5) IAR5 uses a new linker which doesn't support generating outputs of other formats that ELF. (IAR4 projects could select multiple outputs). When loading an image to the board it is often useful to have it as a binary file (eg. for compatibility with SAM-BA). By adding a post-build step to the project setup it is possible to automate this as follows:
- in the IAR5 project options select "Build Actions"
- in the field "Post-build command line" add the command ielftool –bin “$PROJ_DIR$\Release\Exe\uTaskerV1.3.elf”  “$PROJ_DIR$\Release\Exe\uTaskerV1.3.bin”. This will call an IAR utility which can convert between formats and then a binary output will also be created, which can be downloaded to the target outside of IAR workbench.

6) In WinSim.c - static void fnCloseAll(void) it is possible that the simulator exits abnormally when closing USB files. This seems VS version dependent. Add the check of file handle to avoid closing files which are not open (which can causes the possible problem)


    int iUSB_endpoints;
    for (iUSB_endpoints = 0; iUSB_endpoints < NUMBER_OF_USB_ENDPOINTS; iUSB_endpoints++) {
        if (iUSB_Log[iUSB_endpoints] > 0) {
            _close(iUSB_Log[iUSB_endpoints]);
        }
    }

....end (but more may follow..;-)

Regards

Mark
« Last Edit: March 02, 2009, 02:46:05 PM by mark »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2940
    • View Profile
    • uTasker
Re: SAM7X SP4
« Reply #5 on: January 15, 2009, 12:09:53 AM »
Hi All

Here is a quick guide to the new port interrupt support in SP4.


The project has an interrupt routine called fnConfigureInterrupt((void *)&interrupt_setup); which is quite general purpose and one if its jobs is to configure port interrupts.

There is an example in application.c which is enabled when the define IRQ_TEST in that file is defined. It also needs the port interrupt support enabled in the driver by enabling SUPPORT_PORT_INTERRUPTS in app_hw_sam7x.h.

The example fnInitIRQ() in application.c configures a number or IRQs and ports to generate interrupts with various characteristics (rising, falling, level, with defined port priority) and also adds a call back interrupt specifically to a port or a group of port bits. The code in sam7x.c does the rest.

The call back which you define will be called from “within” the interrupt. This is where you can add any code you need. The driver will handle configuration and clearing interrupts etc. so you can concentrate on the application work.

It is interesting to note that the driver allows an interrupt call back to also be assigned to any port bit, not just the IRQ ones. It allows every port to be configured to be either rising, falling or any edge triggered. You probably know that in reality there is only one port state change interrupt per port (A or B) but the driver interrupt handler filters out edges which are not or interest to the application and dispatches a specific call back interrupt handler for each specified bit and edge.

These allow very simple and highly flexible setup in a general manor. The code that does it is in fnConfigureInterrupt() in sam7.x and can of course be used as a reference if direct control is preferred.

If you use the simulator you can check the operation by toggling the port inputs and see that the corresponding user code is executed on the corresponding edge or the specific port.




Regards

Mark


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2940
    • View Profile
    • uTasker
Re: SAM7X SP4
« Reply #6 on: January 15, 2009, 11:16:54 PM »
Hi All

In addition to the fact that the SP4 project now handles simple set up of port interrupts it is worth noting the uTasker simulator capabilities to automatically test port sequences. Here is an example of a script testing toggling of the IRQ0 input (to generate an interrupt which calls the handler routine) and also change other port inputs. The interrupt routine can read the input states and react to certain conditions if required and this script could then be used to check the correct operation.

Script IRQ0.sim content
Code: [Select]
// Toggle IRQ0 input to generate some interrupts. Change also some other inputs which the IRQ routine can read to see changes.
+0   PORT-A-30 0                 // modify just one bit - set IRQ0 input low
+50  PORT-A-30 1                 // set IRQ1 input high (after 50ms)
+50  PORT-A-30 0                 // set IRQ1 input low
+50  PORT-A 00000001             // modify complete port - set all low apart from PA0, which is set high
+50  PORT-A-30 1
+50  PORT-A-30 0
+50  PORT-A 00000002             // modify complete port - set all low apart from PA1, which is set high
+100 PORT-A-30 1                 // after 100ms
+200 PORT-A-30 0
+50  PORT-A 00000004             // continue regularly toggling IRQ0 input and run a '1' along the other PORT A ports
+100 PORT-A-30 1
+200 PORT-A-30 0
+50  PORT-A 00000008
+300 PORT-A-30 1
+300 PORT-A-30 0
+50  PORT-A 00000010
+400 PORT-A-30 1
+400 PORT-A-30 0
+50  PORT-A 00000020
+50  PORT-A-30 1
+50  PORT-A-30 0
+50  PORT-A 00000040
+50  PORT-A-30 1
+50  PORT-A-30 0
+50  PORT-A 00000080
+50  PORT-A-30 1
+50  PORT-A-30 0
+50  PORT-A 00000100
+50  PORT-A-30 1
+50  PORT-A-30 0
+50  PORT-A 00000200
+50  PORT-A-30 1
+50  PORT-A-30 0
+50  PORT-A 00000400
+50  PORT-A-30 1
+50  PORT-A-30 0
+50  PORT-A 00000800
+50  PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00001000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00002000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00004000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00008000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00010000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00020000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00040000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00080000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00100000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00200000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00400000
+500 PORT-A-30 1
+500 PORT-A-30 0
+50  PORT-A 00800000
+500 PORT-A-30 1
+50  PORT-A 01333333
// End of test


If you put this in a simulation folder in the project and open it with Port Sim | Open Script it will toggle the IRQ0 input for you and also play the port input sequence on the other PORT A bits (a running '1'). The file content is easy to understand and modify as required.

This only uses port input but it can be mixed with SPI data, UART data, Ethernet, USB etc… to test quite complicated sequences.

As long as you close the simulator normally (not break in simulator) the simulation file will be set as last used one so following simulations need only use Port Sim | Repeat last script.

Regards

Mark