Search found 22 matches

by samtatasurya
Tue Mar 22, 2016 7:59 am
Forum: STM32 Support
Topic: ADC1, GPT1/14 Conflict on STM32F0
Replies: 3
Views: 3014

Re: ADC1, GPT1/14 Conflict on STM32F0

Hi,

You can disable the tickless mode in chconf.h, this way TIM2 is free for other drivers, also put tick frequency to 1000.

Giovanni

Thank you for the suggestion, Giovanni.
Just to verify, does that mean if I put the tick frequency to 1000, the system tick boundary will be 1 mS? If originally ...
by samtatasurya
Tue Mar 22, 2016 7:33 am
Forum: STM32 Support
Topic: ADC1, GPT1/14 Conflict on STM32F0
Replies: 3
Views: 3014

ADC1, GPT1/14 Conflict on STM32F0

Hi everyone,

I'm using ChibiOS 16.1.4, and the board I'm using is STM32F0 Discovery (STM32F051R8).

I was trying to use both ADC and GPT, but when I was trying to run adcStartConversion() and gptStartContinuous() for the following pairs, my program stopped working:
- ADCD1, GPTD1
- ADCD1, GPTD14 ...
by samtatasurya
Thu Mar 10, 2016 8:04 am
Forum: STM32 Support
Topic: Accessing DMA NDTR for STM32F4
Replies: 6
Views: 5304

Re: Accessing DMA NDTR for STM32F4

Simply use the API with timeout, if the data flow is interrupted or delayed you will get a timeout.

Giovanni

Hi Giovanni,

I forgot to mention that the ChibiOS version I was using was 3.0.4, which doesn't have the timeout functionalities for UART.
I'll try to use 16.1.4 and see whether I can ...
by samtatasurya
Wed Mar 09, 2016 4:05 pm
Forum: STM32 Support
Topic: Accessing DMA NDTR for STM32F4
Replies: 6
Views: 5304

Re: Accessing DMA NDTR for STM32F4

Very complex.

Forget about printing values in real time with 1uS intervals.

I don't know if this could work: use another DMA channel, triggered by a timer, to read NTDR values and store them into a buffer that you can examine later.

I am missing the point of all this anyway.

Giovanni

Hi ...
by samtatasurya
Wed Mar 09, 2016 3:04 pm
Forum: STM32 Support
Topic: Accessing DMA NDTR for STM32F4
Replies: 6
Views: 5304

Re: Accessing DMA NDTR for STM32F4

It is unlikely you can use virtual timers for intervals like 1uS, even a real timer couldn't do that because ISR latencies.

Note that the interval is rounded up to the next system tick wich is 100uS in most demos.

Giovanni

Hi Giovanni,

If that is the case, is there any alternative way I can ...
by samtatasurya
Wed Mar 09, 2016 1:50 am
Forum: STM32 Support
Topic: Accessing DMA NDTR for STM32F4
Replies: 6
Views: 5304

Accessing DMA NDTR for STM32F4

Hi everyone,

I'm currently working with UARTDriver, and I have a question on how to access the "live" value of DMA NDTR.
My idea is using a virtual timer that checks the NDTR value for a fixed interval, e.g. 1uS.

I'm using STM32F4-Discovery and currently trying to access the value via:

UARTD2 ...
by samtatasurya
Wed Mar 09, 2016 1:43 am
Forum: ChibiOS/RT
Topic: Passing Parameters on chVTSet()
Replies: 7
Views: 6377

Re: Passing Parameters on chVTSet()

Hi everyone,

Just an update after my test:


void raiseTimeout(bool *p) {
(*((bool*)p)) = true;
}

void testFunc(void) {
static bool is_timeout;
static virtual_timer_t vt;

is_timeout = false;

chVTReset(&vt);
chVTSet(&vt, MS2ST(200), raiseTimeout, &is_timeout);
}


This particular ...
by samtatasurya
Sat Feb 27, 2016 9:47 am
Forum: ChibiOS/RT
Topic: Passing Parameters on chVTSet()
Replies: 7
Views: 6377

Re: Passing Parameters on chVTSet()

Giovanni wrote:You need to cast it again to (bool *) in the callback.

Giovanni


Hi Giovanni,

Thank you, the code compiled successfully without any error or warning! :D
I'll verify if it works as intended once I actually test it on the board.

Again, thank you everyone for the quick reply!

- Sam
by samtatasurya
Sat Feb 27, 2016 9:36 am
Forum: ChibiOS/RT
Topic: Passing Parameters on chVTSet()
Replies: 7
Views: 6377

Re: Passing Parameters on chVTSet()

Plus your testfunc will create the bool and the timer object on the stack that cannot be guaranteed to exist when the function exits, as it might be over written. You must make them static or global.

Hi Korken,

Thank you for your reminder regarding the lifetime of the variable that's passed to ...
by samtatasurya
Sat Feb 27, 2016 9:34 am
Forum: ChibiOS/RT
Topic: Passing Parameters on chVTSet()
Replies: 7
Views: 6377

Re: Passing Parameters on chVTSet()

void raiseTimeout(bool *p) {
(*p) = true;
}
Your function accepts (bool *p). You need to change it to (void *p).

Hi barthess,

I've just tried changing the parameter of raiseTimeout to (void *p), but instead of warning it is now giving an error and a warning instead.
Error: conflicting types ...