Search found 199 matches

by pito
Thu Feb 06, 2014 10:50 pm
Forum: STM32 Support
Topic: 2 simultaneously sampling ADCs, hw timer triggered
Replies: 2
Views: 3138

2 simultaneously sampling ADCs, hw timer triggered

Hi, new with ADCs. I want to run (STM32F4) 2 ADCs simultaneously, conversion triggered by a hw timer (ie 20kHz sample rate), no jitter, and fill two buffers (I/Q signals). To keep it simple a linear buffer operation (fill the buffer and stop), no DMA. Based what I've seen here the CG cannot do it, a...
by pito
Mon Feb 03, 2014 6:45 pm
Forum: STM32 Support
Topic: Memory sections in linker script
Replies: 11
Views: 7554

Re: Memory sections in linker script - vars in CCM

This works for me - I've tried to place my two float arrays (re[], im[], 32kB each) into CCM: In the linker script add: .. .ccm : { KEEP(*(.ccmbuf)) } > ccmram And in the main.c for example: .. #define intoCCM __attribute__((section(".ccmbuf"))) __attribute__((aligned(4))) #define N 8192 f...
by pito
Mon Feb 03, 2014 11:52 am
Forum: STM32 Support
Topic: Need explanations about Floating Point Unit
Replies: 17
Views: 10797

Re: Need explanations about Floating Point Unit

Ok, it seems this is the fix: In rules.mk: MCFLAGS = -mcpu=$(MCU) -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant in Makefile: # End of user defines ############################################################################## ifeq ($(USE_FPU),yes) USE_OPT += -mcpu=cortex-m4 -mfloat-...
by pito
Mon Feb 03, 2014 10:50 am
Forum: STM32 Support
Topic: Need explanations about Floating Point Unit
Replies: 17
Views: 10797

Re: Need explanations about Floating Point Unit

Nope, the hard does not work properly. It seems it just passes the argument through the function - see sinf (for example): -mfloat-abi=hard: sinf( 1 ) = 1.00000 sinf( 2 ) = 2.00000 sinf( 3 ) = 3.00000 sinf( 4 ) = 4.00000 sinf( 5 ) = 5.00000 sinf( 6 ) = 6.00000 sinf( 7 ) = 7.00000 sinf( 8 ) = 8.00000...
by pito
Sun Feb 02, 2014 8:10 pm
Forum: STM32 Support
Topic: Need explanations about Floating Point Unit
Replies: 17
Views: 10797

Re: Need explanations about Floating Point Unit

As a first step I would try to link the original STM hard fpu libm.a if any - I would expect much better results as with the above gcc one.
by pito
Sun Feb 02, 2014 6:58 pm
Forum: STM32 Support
Topic: Need explanations about Floating Point Unit
Replies: 17
Views: 10797

Re: Need explanations about Floating Point Unit

I've added the path to fpu libs libm.a C:\ChibiStudio\tools\GNU Tools ARM Embedded\4.7 2013q2\arm-none-eabi\lib\armv7e-m\fpu C:\ChibiStudio\tools\GNU Tools ARM Embedded\4.7 2013q2\arm-none-eabi\lib\armv7e-m\softfp and changed: q32= asinf(acosf(atanf(tanf(cosf(sinf(q32)))))); With -mfloat-abi=hard I ...
by pito
Sun Feb 02, 2014 4:51 pm
Forum: STM32 Support
Topic: Need explanations about Floating Point Unit
Replies: 17
Views: 10797

Re: Need explanations about Floating Point Unit

It might be we simply link the math lib without recompiling it for FPU. I would be happy to see a difference in the trigonometric demo I posted - my naive understanding is the demo w/ FPU on shall be at least 2x faster compared to sw math :) PS: I can see a diff when doing simple mult/div (8x), the ...
by pito
Sun Feb 02, 2014 4:05 pm
Forum: STM32 Support
Topic: Need explanations about Floating Point Unit
Replies: 17
Views: 10797

Re: Need explanations about Floating Point Unit

Giovanni, I am using single precision floating point types (32bit) supported by the FPU . .. volatile float q32, p32; .. There is no other way to define a single precision float.. It might be, that there is somewhere a compiler directive defining the single precision float shall be handled as double...
by pito
Sun Feb 02, 2014 3:54 pm
Forum: STM32 Support
Topic: Need explanations about Floating Point Unit
Replies: 17
Views: 10797

Re: Need explanations about Floating Point Unit

I've spent few hours trying to understand the fp in CM4 chibios too.. :) Still coping with it however. Here is a short demo (STM32F4 Discovery demo based), one may try: // Simple math test #include "ch.h" #include "hal.h" #include "chprintf.h" #include <math.h> #define ...
by pito
Sat Feb 01, 2014 9:48 pm
Forum: ChibiStudio
Topic: Error 193
Replies: 11
Views: 9184

Re: Error 193

I am svning against the trunk, a pity :)

Go to advanced search