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.


Topics - twoerner

Pages: [1]
1
NXPTM M522XX, KINETIS and i.MX RT / FLASH blocks
« on: July 20, 2007, 08:32:22 PM »
I have just one more piece of the puzzle to understand: writing data to the flash.

As I understand it, if I wanted to write just 1 byte to flash I first need to erase the entire block in-which that 1 byte is found. How large is the size of the block that must be erased? So to write 1 byte would require me to save and entire block to RAM, modify the 1 byte in RAM, erase the entire block on FLASH, then write the entire block from RAM to FLASH, right?

I've so far been looking at fnEraseFlashSector() and fnWriteBytesFlash(). These are great, but I'll need to know the block size in order to use them correctly. I'm guessing uTasker probably has some functions and/or defines that make this easier?

Looking at uTasker's fnEraseFlashSector() it would appear that 1 flash block is 0x1000 bytes (given that the address is ANDed with ~0x3. But looking through the code that comes with Freescale's dBUG program there is a define in cfm_flash.h that appears as though the block size is 0x800. I guess there's a fair amount of confusion because different texts refer to "block page size", "block sector size", "flash block size", "flash logical block size", ...and several more permutations on what may or may not be the same concept.

I've been playing around with fnEraseFlashSector() and fnWriteBytesFlash() and can see that I can modify bytes of FLASH, but without understanding everything that is going on I can't use them effectively.

2
µTasker general / MAC address
« on: July 20, 2007, 05:45:24 PM »
Hi Mark,

Just out of curiosity, looking at the uTasker demo project, the ethernet's MAC address is hard-coded into the application to an initial value of all zeros and can subsequently be changed by the user. Don't ethernet chipsets have a MAC address stored in them from the manufacturer? Do we have access to this value?

It would be nice if, by default, the MAC address of my board were already set to something expected to be unique (i.e. the value stored in the hardware). Otherwise I'm guessing I can't have two devices on the same network running the uTasker code at the same time (until someone comes along and changes at least one of them)!

Best regards,
    Trevor Woerner

3
NXPTM M522XX, KINETIS and i.MX RT / moving uTasker
« on: July 18, 2007, 09:18:51 PM »
As shipped, the uTasker demo application for M52235 assumes it can run from flash address zero. I would like to move the application so that it resides entirely above 0x36000 and touches nothing below this address (except, of course, for the reset vectors for the stack pointer and the program counter).

Looking at the supplied *.lcf files I found that M52235_BOOT_APP_FLASH.lcf looks somewhat like what I'm looking for. So I created a new target with a copy of this *.lcf file inwhich I change the flash "ORIGIN=" value. This doesn't seem to work. So then I tried to build and run the bare_min_app_rom target (which is the target that uses the M52235_BOOT_APP_FLASH.lcf script) and it doesn't seem to work for me either.

Any idea what I'm doing wrong?

4
µTasker general / updating parameters via the HTTP
« on: July 18, 2007, 06:59:52 PM »
Hi Mark,

I have a minimal HTML page to allow a user to change the device's IP/netmask. My understanding (and this seems to work) is that after changing the, say, IP address in the <input> box the user then needs to

a) click on some button which will cause an "I" variable to have the value of the new IP address (e.g. Ii=192.168.0.4) and an "es" command which causes the values to be saved temporarily and cause a reset to occur
b) once back up the user has 3 minutes to issue an "em" command to validate the settings
c) then click again to issue an "es" command

I would like to be able to do 2 things:
1) have just one button which is smart enough to either say "save" or "verify" based on which state it is in
2) only have to do steps 'a' and 'b' above, in other words I think it would be nice if it were only a 2-step process to change the device's IP address

Does this sound possible? I can post snippets of code if you need a better idea of how I've been modifying things.

5
µTasker general / errors when POSTing
« on: July 13, 2007, 06:35:53 PM »
I have modified parts of http.c -> fnPostFrame() -> HTTP_STATE_POSTING_DATA to look like the following:

Code: [Select]
if (HTTP_session->ucState != HTTP_STATE_DUMPING_DATA) {
    MAX_FILE_LENGTH FileLength = HTTP_session->FileLength;
    HTTP_session->FileLength = usPortLen;
    status = fnHandleWeb(POSTING_DATA_TO_APP, (CHAR *)ucIp_Data, HTTP_session);
    if (status) {
            fnHandleWeb (INFORM_POST_FAILED, 0, HTTP_session);
            return (fnDoWebPage (0, HTTP_session));
    }
    HTTP_session->FileLength = FileLength;

    if ((usPortLen) && (HTTP_session->ptrFileStart == HTTP_session->ptrFile)) {
        HTTP_session->ptrFileStart += FILE_HEADER;
    }
}

My hope was that if I detected an error while receiving the POST'ed file (e.g. checksum error) I could pass that information up (from webInterface.c -> fnHandleWeb() -> POSTING_DATA_TO_APP) and report the error back to the user as soon as possible. If everything was okay then I'd just pass zero back to report success.

This works... however it takes a long time. If there's an error the web browser spins and spins and spins and spins and it takes a long time to display the error page. Any ideas what's going on and how I could get that error page to appear quicker?

BTW: what's the last if() doing in the above code (i.e. the one with the usPortLen)?

6
µTasker general / tftp tests
« on: July 09, 2007, 11:21:39 PM »
app: uTasker sample app V1.3.0 with SP1-4

I don't mean to nit-pick, but in order to play around with the TFTP demo/test software, it was necessary to add the file 'stack\tftp.c' to the project, otherwise the link would fail.

7
NXPTM M522XX, KINETIS and i.MX RT / USE_IP_STATS
« on: July 09, 2007, 11:08:35 PM »
platform: M5223x
app: uTasker sample app V1.3 with SP1-4

I just wanted to point out that simply commenting out '#define USE_IP_STATS' causes the compile to fail. There are 4 places in Hardware\M5223X.c that call fnIncrementEthernetStats(), only one of which is protected by the required '#ifdef USE_IP_STATS'.

8
µTasker general / turning off FS
« on: July 09, 2007, 11:03:51 PM »
platform: M5223x
app: uTasker V1.3 sample app with service packs 1-4

This might sound crazy, but I was wondering if it is possible to turn off (or disable) the uTasker file system in config.h yet still continue to use the HTTP server? In essence all I want is to use the HTTP-POST method to upload a new non-uTasker application to flash.

I replaced the 404 text #define (in config.h) with the POST section of 5admin.htm. Therefore I don't need "files" to serve up the HTML pages. This means I can diasable FTP (to save more space). I don't plan on saving the data that is uploaded with the POST as a "file". So I don't need "files" to serve, and I don't need to save uploaded data as a "file".

From the looks of it I'll need to hack the HTTP.c code since it seems to assume the filesystem is available, but if the above makes sense to you then you'll see that I don't really need files. Any "gotchas" I should consider?

[ps. I can't determine if this should be in this forum or the M5223x forum]

Pages: [1]