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 - eduardovra

Pages: [1]
1
µTasker general / Re: How to use the IIC to get data and send data!
« on: July 31, 2008, 10:22:59 PM »
Hi

How can I make a read to the I2C bus and wait for a response without use the task message method.
Is there any kind of variable that I can pool for the result ?

I want to be sure that a write/read operation is complete before proceed to the next..

Best Regards

2
NXPTM M522XX, KINETIS and i.MX RT / GPIO Pins and Pull-ups in MCF52233
« on: April 11, 2008, 07:48:46 PM »
Hi All !

I'm working in a custom board that uses MCF52233 and I'm having trouble to use PORTTA as GPIO input pin.
Look to my code so you could give your opinion:

Code: [Select]
PTAPAR = 0x00;        // First I configure the port for GPIO Mode
DDRTA &=  0x00;        // Then I set the direction as input
MyVar = PORTIN_SETTA;     // So I try to read the pin state

Although it's disconnected electrically, the voltimeter always shows 0 volts in the pins, so I always read 0 from the port's register.
When I connect the 3.3 V supply directly to pins of the port, I can read high logic state from my code. I conclude there's a problem with the processor's pull-up resistors.
I've read the Processor's Reference Manual from Freescale and it says that all pins that are configured as GPIO have default enabled pull-up resistors internally, but it seems don't have.

Any tips ?

Best Regards

Eduardo

3
NXPTM M522XX, KINETIS and i.MX RT / Re: Flash Clock Setting correction
« on: February 12, 2008, 01:28:56 PM »
Mark

Yes, I've disabled the optimizations for size for debugging purposes.
With respect to #define PROG_SIZE, I've set it to 160 value, but with no success.
Anothing thing I have noted is that sometimes, after calling the fnFlashNow(), the program calls mcf52235_init() function and then it crashes.

Regards

Eduardo

4
NXPTM M522XX, KINETIS and i.MX RT / Re: Flash Clock Setting correction
« on: February 11, 2008, 07:22:31 PM »
Hi Mark

Although I had not discovered the cause of the problem, I've solved it by turning on code optimizations (smaller code) on the CW compiler settings.
I think that there's something related to the size of the object code. With the optimizations enabled, the binary object code generated was about ~50 kb, and with it disabled, the binary generated was almost 85 kb.
However this should not cause any problems, since the size of my program is limited to 96 kb (uTasker default value).
But now, with this change, the program works normally.

Regards

Eduardo

5
NXPTM M522XX, KINETIS and i.MX RT / Re: Flash Clock Setting correction
« on: January 31, 2008, 06:20:48 PM »
Hi Mark

I've seen the value that CFMUSTAT is returning after the program hangs: 0xC0.
My flash granularity is 2k, so the variable ptrSector in the function fnEraseFlashSector could be at maximum 127(??). Because sometimes the value of this variable is set to 255, could this be a problem ?
I was wondering if is there any way I can detect the fault condition and then stop the execution before fnRAM_code() and return an error to the upper level function.

Thank you very much for the help !

Regards

Eduardo


6
NXPTM M522XX, KINETIS and i.MX RT / Re: Problems programing flash memory
« on: January 30, 2008, 07:31:18 PM »
Hi

I'm sorry for the late post but I've made big mistakes here. I was thinking the bootloader was in the same project as baremin (haven't read all the documentation).
I was looking for some way to burn the flash memory of Coldfire using just one binary file, because in the production line the microcontrolers are programed one by one.
Then I've found a GPLed tool that can manipulate Motorola's s19 files, it can the found here:

http://srecord.sourceforge.net/

It has Windows and Linux ports, and can be used to join the bootloader with baremin, this made our work easier.

Regards

Eduardo Vieira

7
NXPTM M522XX, KINETIS and i.MX RT / Re: Flash Clock Setting correction
« on: January 30, 2008, 07:10:38 PM »
Hi Mark

I have checked and it's everything ok with the watchdog. I only disable it when I use the debugger.
When the program hangs, I can see (using the debugger) the sequence of functions calls the cause the trouble, and it's always the same:

  • MyPersonalFuncion()
  • fnSaveNewPars(SAVE_NEW_PARAMETERS)
  • fnDelPar()
  • fnSetParameters()
  • fnEraseFlashSector()
  • fnFlashNow()

Another thing I was thinking about is that I'm using an old version of uTasker (it's date from one year ago, I think it's v1.3 SP1 or SP2). Could this be a problem ?
Another question: Is there any problem in using fnSaveNewPars function a several times consecutively? Because when I do this the program hangs quickly.

Regards

Eduardo Vieira



8
NXPTM M522XX, KINETIS and i.MX RT / Re: Flash Clock Setting correction
« on: January 29, 2008, 08:32:53 PM »
Hi Mark

I have a M52233DEMO board and I'm having some trouble using the fnSaveNewPars() function. Sometimes when I call it my program hangs but sometimes not.
The strange is that, in this situation, the core watchdog of the processor doesn't works, and I have to turn of the equipament to get it working again.
When I look at where the program hangs using the debugger, I get into the function fnFlashNow.

Code: [Select]
static int fnFlashNow(unsigned char ucCommand, unsigned long *ptrWord, unsigned long ulWord)
{
    static unsigned long ulProgSpace[PROG_SIZE/sizeof(unsigned long)];   // SRAM space on long boundary
   
    static void (*fnRAM_code)(void) = 0;

    if (!fnRAM_code) {                                                   // the first time this is used it will load the program to SRAM
    uMemcpy(ulProgSpace, (unsigned char*)fnFlashRoutine, PROG_SIZE);
        fnRAM_code = (void(*)(void))ulProgSpace;
    }


    uDisable_Interrupt();                                                // protect this region from interrupts

#ifdef _WINDOWS                                                          // command sequence - set the word to the address (in the sector)
    if (ucCommand != CMD_SECTOR_ERASE) {
      *ptrWord = ulWord;                                                 // value not important for deletes
    }
#else
    ptrWord += (CFM_FLASH/sizeof(unsigned long));                        // position the write into CFM FLASH (a copy of real FLASH for commands)
    *ptrWord = ulWord;                                                   // value not important for deletes
#endif
    CFMCMD = ucCommand;                                                  // The command

fnRAM_code();                                                       // execute from SRAM

    uEnable_Interrupt();                                                 // safe to accept interrupts again

    return (CFMUSTAT & (ACCERR | PVIOL));                                // if there was an error this will be non-zero
   
}

In this function, I've commented the fnRAM_code() line and then my program runs normaly.
I'm thinking if is it possible that the code get broken from RAM or Flash, or could be another problem ?

Thanks in advance !

Regards

Eduardo Vieira

9
µTasker general / Re: Using TCP in the uTasker project
« on: January 24, 2008, 07:31:31 PM »
Hi Mark!

I working on a project that uTasker will have to work as a protocol converter. A PC will connect (TCP connection) to the board running uTasker and sends some datagrams, then the microcontroler converts them into ethernet raw packets and send to an ASIC chipset that we have. The problem is that some times the TCP datagram sent by the PC application is bigger than the MSS of TCP protocol. In this case, the datagram is divided and sent into two separate packages.
How can I know if the datadram came fragmented and how can I remount them ?

Thanks in advance !
Regards

Eduardo Vieira

10
NXPTM M522XX, KINETIS and i.MX RT / Problems programing flash memory
« on: December 27, 2007, 06:29:28 PM »
Hi Mark
I have a M52233DEMO board and I've got some problems programing the flash memory of the microcontroler in the full mode (Bootloader + BareMin in the same file).
The curious is that it works if a burn them separate.
I'm using CW 5.7.0 for programing and I intend to use CFFlash in the future.

Any tips will be appreciated.

Regards

Eduardo

11
NXPTM M522XX, KINETIS and i.MX RT / Re: SNMP
« on: December 24, 2007, 04:41:46 PM »
Hi
I couldn't find the snmp.c file in my stack folder in the uTasker project.
I'm using uTasker v1.3. Is SNMP supported by this version ?

Regards

Eduardo

Pages: [1]