Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ewan

Pages: [1] 2 3
1
µTasker general / Re: about the sprintf(........)!I can't use !
« on: December 22, 2009, 07:39:36 PM »
Mark,

All is well. It turned out that I needed more libraries.

-       C_4i_CF_MSL.a
-       C_4i_CF_Runtime.a
-       Fp_coldfire.a

All three are required. Since your examples do not need any libraries I had no idea.

Many thanks and a Merry Christmas to all.

Ewan.

2
µTasker general / Re: about the sprintf(........)!I can't use !
« on: December 17, 2009, 02:08:09 AM »
I went through the whole thing of pointing to the new library. (It took me half a day to discover that you add the library to a lib folder you create in the files window of CW.) I added "#include <stdio.h>" to "config.h" and removed the offending typdef of "size_t" from "types.h".

Now "sprintf" works fine but "sscanf" does not. It always returns 0x0 whenever it scans for a number. I am using "C_4i_CF_SZ_MSL.a". Should it be another library?

Thanks in advance,
Ewan.

3
µTasker general / Re: Cannot change the magic number
« on: October 07, 2009, 06:01:50 PM »
I tried without encryption and all worked fine. I then noticed that the VALID_VERSION_MAGIC_NUMBER in the app. is only used with USB. I left it alone (the original 0x1235) and everything worked with encryption except that I must still upload both files (HS.bin and H_Upload_Enc.bin).
When the software is successfully updated, the file in the target's ftp list (H.BIN) is deleted. It appears that the HS.BIN is deleted (or flaged) since I must resend it too to update the app..

I am about as confused as I ever want to be.   ???
Thanks,
Ewan.


4
µTasker general / Re: Cannot change the magic number
« on: October 07, 2009, 04:03:53 PM »
Martin,

I am changing the bootloader too by erasing all sectors and reloading a new bootloader and a new app using the AxBDM hardware. I then switch to ethernet to try to load new software. It will not do it with the new magic number. It seems that I am missing changing a magic number somewhere but, to my knowledge there are only three places. One is in the bootloader, one is in the app and the third is in the .bat file. I am puzzled.

Thanks,
Ewan.

5
µTasker general / Cannot change the magic number
« on: October 07, 2009, 12:54:15 AM »
My project has just restarted after almost a year.

I am using the MCF52233 with an AT45DB321 SPI chip and encrypted bootloading. With the magic number set to 0x1235 I can upload and run new software using ftp (with a small caveat). I then set the defines in "application.h" in the app and in "uTaskerBootLoader.c in the bootloader to 0x4235. I then also edited the "BM-Convert_Encrypt.bat" batch file to suit. I can no longer upload new software. Upon reseting the target, it comes up right away with no delay. I assume the boot loader does not like the new file(s) and goes with the old one.

The caveat is that I seem to need both "H_Upload_Enc.bin" and "HS.bin" for it to work with 0x1235.

Any help would be appreciated and prevent an ulser.

Regards,
Ewan Macpherson.

6
µTasker general / CPU heavy task
« on: December 03, 2008, 09:20:28 PM »
Mark,

What is the general means of dealing with a task that consumes a lot of CPU time? In my case, 3 seconds of computation.

Thanks,
Ewan.

7
Mark,

I had not added extra code. It was the optimization. The encryption works well.

Many thanks once again,
Ewan.

8
NXPTM M522XX, KINETIS and i.MX RT / Overflow in .flash1 using _ENCRYPTED
« on: December 01, 2008, 06:34:46 PM »
I have the boot loader working fine with my SPI chip. I decided to try out the encryption but I get the linker message "Overflow in segment: flash1 from section: .flash1 Segment reserved size is 0x0400 -- Overflow of: 0x0050". Is there something I need to take out or move to another module?

Thanks,
Ewan.

9
Mark,

Well, it all works now. My problem, it seems, (well my most significant one at least) was my failure to understand that uFILE_SYSTEM_END exists in the CPU on-chip flash. I was putting it at the end of the SPI chip.

Many thanks for your efforts.

Regards,
Ewan.

10
Mark,

Here are the files. I sent them by e-mail too.

Regards,
Ewan.

11
Mark,

OK, will do. But....... As luck would have it my VC6 has crashed and I have to repair that first.
I don't know how you have the time but I'm glad that you do.

Best Regards,
Ewan.

12
Mark,

I checked the calculations and I find that the file should be at (0x8400 * 17) + 0x40000 = 0xcc400. I debuged the application and it is there with its headers in good order. I then checked the bootloader settings and found some quite wrong (I think). The current settings I have are:-

Code: [Select]
        #define uFILE_START 0x3f000                                      // FLASH location near end
        #define SINGLE_FILE_SIZE (0x8400)                                // each file a multiple of 32k
        #define FILE_SYSTEM_SIZE (32*SINGLE_FILE_SIZE)                   // 1meg reserved for file system

        #ifdef SPI_SW_UPLOAD
            #define QSPI_CS0_LINE          PORT_QS_BIT3                  // CS0 line used when SPI FLASH is enabled
            #define SPI_CS0_PORT           PORTQS                        // for simulator compatibility {5}
            #define CS0_LINE               QSPI_CS0_LINE                 // for backward compatibility {5}

            #define SPI_FLASH_ATMEL                                      // {9} default if nothing else defined
            #define SPI_FLASH_PAGE_LENGTH  528                           // standard page size (AT45DB041 B-device only allows 256)
            #define SPI_FLASH_BLOCK_LENGTH (8*SPI_FLASH_PAGE_LENGTH)     // block size - a block can be deleted
            #define SPI_FLASH_SECTOR_LENGTH (64*4*SPI_FLASH_PAGE_LENGTH) // exception sector 0a is 2k and sector 0b is 62k
            #define SPI_FLASH_PAGES        2048
            #define SPI_DATA_FLASH_SIZE    (SPI_FLASH_PAGES*SPI_FLASH_PAGE_LENGTH)
        #endif

Now it blows its stack or something as it ends up in the default interrupt handler.

Any ideas?

Thanks for you patience.

Regards,
Ewan.

13
Another day.

I noticed that I had not defined SPI_FILE_SYSTEM in "config.h". When I changed this I got redefine errors for uFILE_START and SINGLE_FILE_SIZE. I then replaced the files uTaskerBootLoader.c, config.h and types.h with copies of the originals and started again but to no avail. I get these errors whether or not I define FLASH_FILE_SYSTEM. I seem to remember reading some time ago that you cannot have SPI_SW_UPLOAD with FLASH_FILE_SYSTEM, but I can no longer find the reference. It appears I am missing some basics but, after reading "uTasker - uFileSystem" again, I am no further along. What can it be?

Regards,
Ewan.

14
Mark,

I checked and modified the page size (it was incorrect). SPI_SW_UPLOAD was correct. I used your formula for UPLOAD_FILE_LOCATION and the following results:-
1) UPLOAD_FILE_LOCATION == 0xbbc00
2) FILEHEADER == 5
3) SIZE_OF_UPLOAD_HEADER == 8
4) magic number = 0x000c
5) ptrFile == 0xbbc0d

Onward!
Ewan.

15
Mark,

I changed the FILE_SYSTEM_SIZE as shown below.

Code: [Select]
#ifdef FLASH_FILE_SYSTEM
    #if defined SPI_FILE_SYSTEM                                          // this is a test setup for external SPI FLASH, with the parameters at the end of internal FLASH
        #define PARAMETER_BLOCK_START 0x3f000                            // {34} FLASH location at 2 parameter blocks short of end of internal FLASH
        #define uFILE_START 0x40000                                      // immediately after internal FLASH

        #define SINGLE_FILE_SIZE (FILE_GRANULARITY)                      // each file a multiple of 16k (64k ST)
        #if SINGLE_FILE_SIZE < 20000                                     // {36}
            #define FILE_SYSTEM_SIZE (64*SINGLE_FILE_SIZE)               // 1Meg reserved for file system (plus parameter blocks) {34} [PAR_BLOCK_SIZE removed]
        #else
//            #define FILE_SYSTEM_SIZE (16*SINGLE_FILE_SIZE)               // 1Meg reserved for file system {35}
            #define FILE_SYSTEM_SIZE (32*SINGLE_FILE_SIZE)   // ewan     // 1Meg reserved for file system {35}
        #endif
    #else                                                                // this is the normal set up for internal FLASH
        #if defined M52210DEMO                                           // {19}
            #define PARAMETER_BLOCK_START 0xe000                         // {34} FLASH location at 56k start
            #define uFILE_START 0xf000                                   // FLASH location at 60k start

            #define SINGLE_FILE_SIZE (1*FLASH_GRANULARITY)               // each file a multiple of 2k
            #define FILE_SYSTEM_SIZE (4*SINGLE_FILE_SIZE)                // 8k reserved for file system
        #elif defined M52211EVB || defined M52221DEMO                    // 64k file system to allow USB SW upload to be tested
            #define PARAMETER_BLOCK_START 0xf000                         // FLASH location at 60k start
            #define uFILE_START 0x10000                                  // FLASH location at 64k start

            #define SINGLE_FILE_SIZE (1*FLASH_GRANULARITY)               // each file a multiple of 2k
            #define FILE_SYSTEM_SIZE (32*SINGLE_FILE_SIZE)               // 64k reserved for file system
        #else
            #define PARAMETER_BLOCK_START 0x18000                        // {34} FLASH location at 96k start
            #define uFILE_START 0x19000                                  // FLASH location at 100k start

            #define SINGLE_FILE_SIZE (1*FLASH_GRANULARITY)               // each file a multiple of 2k
            #define FILE_SYSTEM_SIZE (78*SINGLE_FILE_SIZE)               // 156k reserved for file system
        #endif
    #endif
#else
    #define PARAMETER_BLOCK_START 0x3f000                                // {40} FLASH location at 2 parameter blocks short of end of internal FLASH (suitable for 25k FLASH size)
#endif

This fixed the name change and the croping of the file. I checked that the file retrieved from the chip is identical to the original. I checked that the length reported in the header is correct along with the magic number of 0x1234. I do not know about the checksum.

When I use the debugger, however, "file_header->usMagicNumber" reports 0x6c3e and the length is 1013478509.
Clearly some progress has been made but I am not there yet. Any other ideas while I keep digging will be appreciated.

Thanks,
Ewan.

Pages: [1] 2 3