All the F1-specific drivers are still untested, it is possible there are problems originated during the porting.
I have still to run the applications under ./testhal/STM32F1xx so be careful.
Giovanni
CB3.0 F100 - I2C issues
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: CB3.0 F100 - I2C issues
Hi,
I fixed a problem that could have caused that panic, could you give it another try?
Giovanni
I fixed a problem that could have caused that panic, could you give it another try?
Giovanni
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: CB3.0 F100 - I2C issues
Also fixed another problem in the DMA handler affecting all drivers using DMA.
Everything should be OK now.
Giovanni
Everything should be OK now.
Giovanni
Re: CB3.0 F100 - I2C issues
It started to work somehow, but:
1. when I2C stuff enabled it crashes in an unhandled exception (I will investigate)
2. getting compile error: 'RDY_OK' undeclared here (not in a function)
usually returned by i2cMasterTransmitTimeout() - is being lost somewhere, so I have to def it in my source as 0
3. even set #define CH_CFG_ST_RESOLUTION 32
the chVTGetSystemTimeX(); counts 16bit.. chTimeNow() worked fine 32bit
4. what is the meaning of:
#define CH_CFG_RTC_FREQUENCY 72000000
plz?
1. when I2C stuff enabled it crashes in an unhandled exception (I will investigate)
2. getting compile error: 'RDY_OK' undeclared here (not in a function)
usually returned by i2cMasterTransmitTimeout() - is being lost somewhere, so I have to def it in my source as 0
3. even set #define CH_CFG_ST_RESOLUTION 32
the chVTGetSystemTimeX(); counts 16bit.. chTimeNow() worked fine 32bit
4. what is the meaning of:
#define CH_CFG_RTC_FREQUENCY 72000000
plz?
Last edited by pito on Tue Oct 08, 2013 7:27 pm, edited 1 time in total.
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: CB3.0 F100 - I2C issues
RDY_OK has been renamed to MSG_OK, CH_CFG_RTC_FREQUENCY is the frequency of the realtime counter on the F4 it should be 168000000 but it is not really important unless using the RTC-related time conversion macros.
Giovanni
Giovanni
Re: CB3.0 F100 - I2C issues
I have a task, which does:
Even I set
after reaching chtime1 ~65000 the seconds_counter and chtime1 show 6534 and 4..
I suspect something weird with chVTGetSystemTimeX() or with systime_t size. The variant with chTimeNow() worked fine..
PS: seconds_counter counts 100/second, but that is not important here..
Code: Select all
static THD_WORKING_AREA (waThread1, 128);
static THD_FUNCTION (Thread1, arg) {
(void)arg;
chRegSetThreadName("counter");
// Time for next read.
systime_t wakeTime = chVTGetSystemTimeX();
while (TRUE) {
wakeTime += 10;
chThdSleepUntil(wakeTime);
seconds_counter++;
chtime1 = chVTGetSystemTimeX();
}
}
Even I set
Code: Select all
#define CH_CFG_ST_RESOLUTION 32
after reaching chtime1 ~65000 the seconds_counter and chtime1 show 6534 and 4..
I suspect something weird with chVTGetSystemTimeX() or with systime_t size. The variant with chTimeNow() worked fine..
PS: seconds_counter counts 100/second, but that is not important here..
- Giovanni
- Site Admin
- Posts: 14457
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: CB3.0 F100 - I2C issues
chVTGetSystemTimeX() is exactly chTimeNow(). The counter cannot be 32bits because the tickless mode uses TIM2 and TIM2 is 16 bits on the STM32F1 (it should give you a compile error however).
If you need a 32 bits counter then disable the tickless mode or use another STM32.
Giovanni
If you need a 32 bits counter then disable the tickless mode or use another STM32.
Giovanni
Re: CB3.0 F100 - I2C issues
Ah, yea, tickless mode requires a hw counter.. thanks.
The next step is the I2c..
The next step is the I2c..
Re: CB3.0 F100 - I2C issues
Chibi30\os\hal\ports\STM32\I2Cv1\i2c_lld.c
l.146
l.146
Code: Select all
osalDbgCheck((i2cp != NULL) &&
(clock_speed > 0) &&
(clock_speed <= 4000000)); <<<< Typo
Re: CB3.0 F100 - I2C issues
Including the following code into my source causes the system halts around i2cstart (it works in trunk).. If somebody may see an issue below, give me a hint , plz
Code: Select all
..
#include "chTinyRTC8563.h"
..
static const I2CConfig i2cfg1 = {OPMODE_I2C, 400000, FAST_DUTY_CYCLE_16_9}; //40Mhz clock
..
main:
..
/* Starts I2C1 PB6=SCL PB7=SDA */
palSetPadMode(GPIOB, 6, PAL_MODE_STM32_ALTERNATE_OPENDRAIN);
palSetPadMode(GPIOB, 7, PAL_MODE_STM32_ALTERNATE_OPENDRAIN);
i2cStart(&I2CD1, &i2cfg1); <<<<<<<<<<
if (RTC_PCF8563_isrunning()) {
..
Who is online
Users browsing this forum: No registered users and 59 guests