Page 3 of 4

Re: Abstract EEPROM access

Posted: Fri Apr 06, 2012 10:21 pm
by trunet
Giovanni wrote:Note that higher numbers are lower priorities so you did the exact opposite. Try an I2C priority set to 5 and see if it makes a difference.

I tried with 1, 3, 5, 8, 10 and 13 and none works.

barthess wrote:I do not know how to libmaple does, but I would insert short sleeps in outln() to give some time to UART to printout messages from buffer.

this helps my serial communication problems.

but, it's freezing now. it reads the first EEPROM value but than it freezes on the loop. sleeps does not help either.

Code: Select all

Trunetcopter
EEPROM Write...
Altitude:000000
Pressure:062529
Temperature:064591
EEPROM Read...
AQUI1
AQUI2
AQUI3
AQUI4
000 AQUI1
AQUI2


last code: http://github.com/trunet/trunetcopter

Re: Abstract EEPROM access

Posted: Sat Apr 07, 2012 6:44 am
by Giovanni
Using the default settings the usable priorities go from 2 to 15, 0 and 1 are reserved for "fast interrupts" and must not be used by normal device drivers.

The only obvious problem with your code is that you return from the main() function, returning from the main() stops the system into an infinite loop, see the startup file crt0.c. If you don't need the main() thread then you should enter a loop with a chThdSleepMilliseconds(1000) inside instead.

Anyway, you definitely need a JTAG/SWD probe if you are going to develop something complex, even a STM32xx-Discovery board could do that and you can have them for few $ or even for free.

Giovanni

Re: Abstract EEPROM access

Posted: Sat Apr 07, 2012 7:47 am
by trunet
Giovanni wrote:Using the default settings the usable priorities go from 2 to 15, 0 and 1 are reserved for "fast interrupts" and must not be used by normal device drivers.

The only obvious problem with your code is that you return from the main() function, returning from the main() stops the system into an infinite loop, see the startup file crt0.c. If you don't need the main() thread then you should enter a loop with a chThdSleepMilliseconds(1000) inside instead.

Anyway, you definitely need a JTAG/SWD probe if you are going to develop something complex, even a STM32xx-Discovery board could do that and you can have them for few $ or even for free.

I just returned from main() because of compiler warnings.

The hackerspace I'm member here(I'm in Brazil) have a JATG. I'm going there next week to see what's happening. Thanks for your time and patience I'll be back further.

Re: Abstract EEPROM access

Posted: Sun Apr 28, 2013 12:14 pm
by jwblanski
Hello, I'm also trying to access the EEPROM AT24LC256 with a processor SMT32F103. Has a detail that should be taken into consideration.
Examples of códio are provided by ST to memory 24C08, which the access address is 8 bits. To connect 24C256 memory is required to send a 16-bit address. I still can not configure the I2C peripheral address for the STM32F103 by 16 bits. Have you ever got? If you could, I would be very grateful if you could send me the code. ([email protected]). Thank you.
If you want I make a code to read BMP images in SD card and show the photos on display.

Re: Abstract EEPROM access

Posted: Sun Apr 28, 2013 2:05 pm
by barthess
jwblanski wrote:I still can not configure the I2C peripheral address for the STM32F103 by 16 bits.

You can not. 16-bit is address of byte inside EEPROM storage array. Address of AT24LC256 on bus is 8-bit.

Re: Abstract EEPROM access

Posted: Fri Feb 07, 2014 2:28 pm
by max_xxv
Hi,
I'm newbie of Chibios, I've tested thread, PWM, interrupt usage and now I need to dialog with 24LC256 EEPROM. Have you a project that I can use as reference to see bathess eeprom implementation?

I've read README in downloaded file from https://github.com/barthess/24aa but I've some dubt on main.c structure, include file and Makefile configuration, can you help me?

Best regards
max_xxv ( Mauro )

Re: Abstract EEPROM access

Posted: Fri Feb 07, 2014 5:46 pm
by barthess
max_xxv wrote:but I've some dubt on main.c structure

The simplest example I have is https://github.com/barthess/eeprom_burn
Just delete all USBSerial stuff.
max_xxv wrote:Makefile configuration

just add 24aa.c and eeprom.c to CSRC variable

P.S. I would recommend C++ variant of this library because C variant
is slightly outdated and currently is not supported any more.

Re: Abstract EEPROM access

Posted: Mon Feb 10, 2014 9:54 am
by max_xxv
ok, eeprom_burn-master is clear, I like it :)

But I've a problem with eeprom function and my ATM32F407 IC, I've some error on part of code like this:

Code: Select all

  eeprom_cycle = BKP->DR1;
  eeprom_cycle = eeprom_cycle << 16;
  eeprom_cycle += BKP->DR2;


I've commented this part of code for test...

Now I've a problem on this row:

Code: Select all

      chFileStreamSeek(&EepromFile, 0);


debug jump on :

Code: Select all

void _unhandled_exception(void) {

  while (TRUE)
    ;
}



Obviously I've placed

Code: Select all

/* mounted EEPROM */
EepromFileStream EepromFile;
in my code :)

Re: Abstract EEPROM access

Posted: Tue Feb 11, 2014 4:28 pm
by barthess
max_xxv wrote:void _unhandled_exception(void)

This almost always caused by incorrect pointer handling somewhere.

Re: Abstract EEPROM access

Posted: Tue Feb 11, 2014 6:06 pm
by max_xxv
ok, but in my code there isn't more than inclusion of your code :)

Have you never used it on STM32F4 MCU?