public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* [Bug 1001268] New: I2C driver for STM32 Cortex M3
@ 2011-06-21 15:58 bugzilla-daemon
  2011-06-21 20:30 ` [Bug 1001268] " bugzilla-daemon
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bugzilla-daemon @ 2011-06-21 15:58 UTC (permalink / raw)
  To: ecos-patches

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001268

           Summary: I2C driver for STM32 Cortex M3
           Product: eCos
           Version: CVS
          Platform: stm32e_eval (ST STM3210E EVAL board)
        OS/Version: Cortex-M
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: low
         Component: Patches and contributions
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: roscmar@gmail.com
                CC: ecos-patches@ecos.sourceware.org
             Class: Advice Request


Created an attachment (id=1291)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1291)
Patch for STM32 I2C driver package

Attached with this is a patch which includes the I2C driver package for the
STM32 Cortex M3 microcontroller and the necessary register field definitions in
the variant header file.
It has been tested on a ST STM3210E EVAL board.

The driver implements the I2C Master using either interrupts or register
polling.
The I2C Host and the DMA mode are not implemented (yet).

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001268] I2C driver for STM32 Cortex M3
  2011-06-21 15:58 [Bug 1001268] New: I2C driver for STM32 Cortex M3 bugzilla-daemon
@ 2011-06-21 20:30 ` bugzilla-daemon
  2011-06-21 20:43 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2011-06-21 20:30 UTC (permalink / raw)
  To: ecos-patches

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001268

John Dallaway <john@dallaway.org.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john@dallaway.org.uk

--- Comment #1 from John Dallaway <john@dallaway.org.uk> 2011-06-21 21:30:19 BST ---
Martin, thank you for your contribution to eCos which will be reviewed in due
course.

We will need a copyright assignment from you before we can add this to the eCos
repository. Can you confirm that you are able to make an assignment please?
Details at: http://ecos.sourceware.org/contrib.html

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001268] I2C driver for STM32 Cortex M3
  2011-06-21 15:58 [Bug 1001268] New: I2C driver for STM32 Cortex M3 bugzilla-daemon
  2011-06-21 20:30 ` [Bug 1001268] " bugzilla-daemon
@ 2011-06-21 20:43 ` bugzilla-daemon
  2011-06-22 13:05 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2011-06-21 20:43 UTC (permalink / raw)
  To: ecos-patches

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001268

--- Comment #2 from John Dallaway <john@dallaway.org.uk> 2011-06-21 21:42:47 BST ---
Martin, do you have an STM3210E-EVAL board or was the I2C driver coded against
another hardware platform? I was thinking it would be useful to add an eCos
test case to the STM3210E-EVAL platform HAL which illustrates use of the driver
by reading the on-board temperature sensor.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001268] I2C driver for STM32 Cortex M3
  2011-06-21 15:58 [Bug 1001268] New: I2C driver for STM32 Cortex M3 bugzilla-daemon
  2011-06-21 20:30 ` [Bug 1001268] " bugzilla-daemon
  2011-06-21 20:43 ` bugzilla-daemon
@ 2011-06-22 13:05 ` bugzilla-daemon
  2011-06-22 13:08 ` bugzilla-daemon
  2013-04-03 16:28 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2011-06-22 13:05 UTC (permalink / raw)
  To: ecos-patches

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001268

--- Comment #3 from Martin Rösch <roscmar@gmail.com> 2011-06-22 14:05:33 BST ---
(In reply to comment #2)
> Martin, do you have an STM3210E-EVAL board or was the I2C driver coded against
> another hardware platform? I was thinking it would be useful to add an eCos
> test case to the STM3210E-EVAL platform HAL which illustrates use of the driver
> by reading the on-board temperature sensor.

John, yes I have an STM3210E-EVAL board at hand and I have developed the driver
against that board. I tried to communicate with the temperature sensor, but due
to a limitation of the microcontroller, it is not possible to use the I2C1 bus
when the FSMC is activated (see Errata Sheet of the STM32F101xC/D/E in section
2.6.9).

So, to test, I modified the Eval Board and connected an external I2C device.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001268] I2C driver for STM32 Cortex M3
  2011-06-21 15:58 [Bug 1001268] New: I2C driver for STM32 Cortex M3 bugzilla-daemon
                   ` (2 preceding siblings ...)
  2011-06-22 13:05 ` bugzilla-daemon
@ 2011-06-22 13:08 ` bugzilla-daemon
  2013-04-03 16:28 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2011-06-22 13:08 UTC (permalink / raw)
  To: ecos-patches

Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001268

--- Comment #4 from Martin Rösch <roscmar@gmail.com> 2011-06-22 14:08:05 BST ---
(In reply to comment #1)
> Martin, thank you for your contribution to eCos which will be reviewed in due
> course.
> 
> We will need a copyright assignment from you before we can add this to the eCos
> repository. Can you confirm that you are able to make an assignment please?
> Details at: http://ecos.sourceware.org/contrib.html

John, yes I will make that assignment soon.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1001268] I2C driver for STM32 Cortex M3
  2011-06-21 15:58 [Bug 1001268] New: I2C driver for STM32 Cortex M3 bugzilla-daemon
                   ` (3 preceding siblings ...)
  2011-06-22 13:08 ` bugzilla-daemon
@ 2013-04-03 16:28 ` bugzilla-daemon
  4 siblings, 0 replies; 6+ messages in thread
From: bugzilla-daemon @ 2013-04-03 16:28 UTC (permalink / raw)
  To: ecos-patches

Please do not reply to this email, use the link below.

http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001268

--- Comment #5 from Mike Jones <mjones@linear.com> ---
Created attachment 2151
  --> http://bugs.ecos.sourceware.org/attachment.cgi?id=2151&action=edit
Update STM32 I2C Support

I tried to contact Martin to see if he had updated code he was willing to
contribute, etc, but so far no reply. I am posting a patch. The patch contains:

- Updated init function and base defines so that the I2C support works on a
STM3240G-EVAL and should work for other STM32F4XX devices.
- Attempted to preserve STM32F1XX support but have no means to test
- Added support for SMBus timeout
- Fixed fast mode clock calculation
- Tested with PMBus/SMBus application consisting of three devices
- Tested with polling and interrupt driven modes
- Added loopback test for others to use

Some areas that may warrant change.

- The alternate pin assignments are set to the other two pins, but this is not
flexible in that it will not adapt to a custom design. It could be improved to
enter arbitrary pins in the CDL.
- The second I2C is not set to any particular pins of importance and could use
the same flexibility.
- The ACK portion of the I2C API is not active in the code. This prevents
lockups. If there is ever a reason to allow control it could be added, but it
needs some thought as to how to prevent lockup.
- The clock speed is ignored if changed in the instantiation of the i2c struct.
A code override may be added in the future if desired.

There is an inconsistency with the Kinetis driver. Kinetis I2C takes a period
in the CDL. I think this should be changed to frequency and will change it when
other work by Ilija completes.

On the eval board this code was reliable in with a real application. Overtime
it will get more use and I will fix anything I find. I would not hesitate to
use the patch if you need I2C on this platform. However, if anyone has a board
with STM32F1XX it would help to test this patch to ensure that version still
works. The difference between F1 and F4 is in the GPIO configuration registers.
I made almost no changes to the core code, so if it does not work, it is almost
certain to be in the init code.

I believe Martin has an assignment. I have one. So we should be able to get
this into the codebase.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-03 16:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-21 15:58 [Bug 1001268] New: I2C driver for STM32 Cortex M3 bugzilla-daemon
2011-06-21 20:30 ` [Bug 1001268] " bugzilla-daemon
2011-06-21 20:43 ` bugzilla-daemon
2011-06-22 13:05 ` bugzilla-daemon
2011-06-22 13:08 ` bugzilla-daemon
2013-04-03 16:28 ` bugzilla-daemon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).