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

Pages: [1]
1
Hello,

it seems to me, that an incorrect mask is used in the macro "_CONFIG_PORT_OUTPUT_FAST_HIGH" (uTasker 1.4.7 - kinetis.h)  to filter the relevant bits.
I think that  "GPIO##ref##_PDDR |= ((pins) & 0xffff);" needs to be changed to GPIO##ref##_PDDR |= ((pins) & 0xffff0000);.

The macro did not work with Keil until the value was changed.
Can you confirm this issue ?

Regards

Fabian

2
Hello,

the register was not defined as volatile.  ::)
Now it works correctly.

How should this behavior be reported to Freescale ?

Regards

3
Hello,

thank you for your quick reply.

My Processor is a MK64FN1M0VLL12 (1N83J). I did some tests an i think that this errata applies to the K64 too.

When i set the optimisation to O1, then my task would not start the timer (vanilla uTasker 1.4.7).

Code: [Select]
static void PIT_INT_HANDLER(void){
_TOGGLE_PORT(B, LED_BLUE);
}

extern void fnPITInit (TTASKTABLE *ptrTaskTable){
/* Task is started 4 seconds after boot */
PIT_SETUP pit_setup;// interrupt configuration parameters
pit_setup.int_type = PIT_INTERRUPT;
pit_setup.int_handler = PIT_INT_HANDLER;
pit_setup.int_priority = PIT0_INTERRUPT_PRIORITY;
pit_setup.count_delay = PIT_US_DELAY(10400);
pit_setup.mode = PIT_PERIODIC;
pit_setup.ucPIT = 0;
fnConfigureInterrupt((void *)&pit_setup);                            // enter interrupt for PIT0 test
}


I replaced the init sequence in kinetis.c by direct writes to verfy my results:
Code: [Select]
* (unsigned long *)(0x4004803C) |= 0x00800000;
* (unsigned long *)(0x40037000) = 0;
//POWER_UP(6, SIM_SCGC6_PIT);                                  // {68} ensure the PIT module is powered up
//PIT_MCR = 0;


After the verification, I inserted  "(void)PIT_MCR;" into kinetis.c, but this does not work. The command seems to be ignored
by the compiler. (Screenshots)

Replacing "(void)PIT_MCR;" by  asm(" nop"), causes the desired effect (timer starts):
Code: [Select]
POWER_UP(6, SIM_SCGC6_PIT);                                  // {68} ensure the PIT module is powered up
asm(" nop");
PIT_MCR = 0;

Is there any other change required, use the instruction "(void)PIT_MCR;" ?

Regards,

Fabian

4
NXPTM M522XX, KINETIS and i.MX RT / PIT configuration failure (KDS)
« on: March 04, 2015, 03:29:53 PM »
Hello,

for an application with a Kinetis K64 Processor i need a PIT to trigger a periodic task.
A task executed, 5 seconds after startup, is used for the PIT configuration. But if i do not not power up the PIT module separately, the PIT is not startet.
With a breakpoint after POWER_UP(6, SIM_SCGC6_PIT);  / before the PIT_MCR register is written in "fnConfigureInterrupt" [kinetis.c], it works as well.

Without ececuting the power up sequence for the PIT, i need to clear the PIT_MCR_MDIS flag manually to start the PIT.

This error only does occur in a larger project, but not in a vanilla uTasker 1.4.7.

May there be a race condition ?
I attached a screenshot of the assembly code from the working and the non-working configuration.

Regards,

Fabian

Code: [Select]
static void timed_main_Task(void){
.... Code ....
}

extern void fnXSetupTask (TTASKTABLE *ptrTaskTable){
/*configure PIT  */
PIT_SETUP x_pit_setup;
x_pit_setup.int_type = PIT_INTERRUPT;
x_pit_setup.int_handler = timed_main_Task;
x_pit_setup.int_priority = X_PIT_PRIORITY;
x_pit_setup.count_delay = PIT_US_DELAY(104000);
x_pit_setup.mode = PIT_PERIODIC;
x_pit_setup.ucPIT = 0;
POWER_UP(6, SIM_SCGC6_PIT);
fnConfigureInterrupt((void *)&x_pit_setup);

}


5
Hello,

in my uTasker version (1.4) the preprocessor macro _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_HIGH uses the same bit shifting routine as in _CONFIG_DRIVE_PORT_OUTPUT_VALUE_FAST_LOW function to align the adress bits for the PORTx_GPCHR register. (kinetis.h)

PORT##ref##_GPCLR = (((pins) << 16) | (chars | PORT_MUX_GPIO)) is used in both functions.

Is the function correct or is there a defect in my version ?

I expected a function like PORTx_GPCHR = (((pins) & 0xffff0000) | chars | PORT_MUX_GPIO) there.

Regards

Fabian

Pages: [1]