EXHAL

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general. This forum is NOT for support.
User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

EXHAL

Postby RoccoMarco » Sun Sep 28, 2014 12:31 pm

Every day I am discovering something new about ChibiOS and understanding its structure new ideas come out.

Over the years, playing with the embedded, I have created several libraries for external devices that I have systematically abandoned.

Now I'm taking all these libraries and I'm rearranging them in a library entirely based on ChibiOS that emulates its structure. Its name is EXHAL or EXtended HAL.

I'm trying to emulate the style of ChibiOS obviously with a big amount of lacks.

I'm starting from MEMS L3GD20 e LSM303DLHC.

Image

ASAP I will post code and demos here...

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: EXHAL

Postby Tectu » Mon Sep 29, 2014 4:50 pm

Will this end up in the community repository?


~ Tectu

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

Re: EXHAL

Postby RoccoMarco » Mon Sep 29, 2014 5:10 pm

Hi Tectu, how are you?
I will post my code on this thread.

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

Re: EXHAL

Postby RoccoMarco » Tue Oct 07, 2014 11:24 am

Hi,
I have to adjust few things, but the support for Gyroscope over SPI is almost done.

There are 2 layer, the layer that implements api and a platform/device depending layer.

Platform layer include some devices libs that are general purpose and can work standalone (Losing signal processing functionality, usually devices libs just offer access to register).

EXHAL is totally compatible with chDebugChecks and Assertion.

EXHAL subsystem are structured as a generic complex ChibiOS\HAL driver.

I will make some other arrangements and I will post the code here.

User avatar
Giovanni
Site Admin
Posts: 13008
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 742 times
Been thanked: 620 times
Contact:

Re: EXHAL

Postby Giovanni » Tue Oct 07, 2014 12:33 pm

What Tectu asked is if you want your code on the community repository where this kind of extensions are supposed to go.

Giovanni

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

Re: EXHAL

Postby RoccoMarco » Tue Oct 07, 2014 12:54 pm

Yes, I want.
Actually I don't know how to submit it on the repository, but I will ask when the code is sufficiently stable to be submitted.
RM

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: EXHAL

Postby Tectu » Tue Oct 07, 2014 4:05 pm

As per this thread, barthess and I are currently restructuring the whole repository thing.
We'll let you know once we are ready for the first real-world usage test ;-)


~ Tectu

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

Re: EXHAL

Postby RoccoMarco » Mon Oct 20, 2014 11:16 pm

Not fully tested but the gyroscope module seems to work properly

Ciaooo,
RM
Attachments
ARMCM4-STM32F3-EXHAL_00.7z
STM32F3 discovery l3gd20 demo
(24.78 KiB) Downloaded 117 times
ARMCM3-STM32F103_INEMO-EXHAL_00.7z
iNEMO l3gd20 demo
(24.59 KiB) Downloaded 127 times

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

Re: EXHAL

Postby RoccoMarco » Tue Oct 21, 2014 6:31 pm

Added accel support. Next step would be to include compass support and compass calibration. Then i will port the ST iNEMO engine on exHAL.
Attachments
EXHAL demos.7z
STM32f3 discovery and iNEMO exHAL demos
(24.49 KiB) Downloaded 144 times

User avatar
RoccoMarco
Posts: 635
Joined: Wed Apr 24, 2013 4:11 pm
Location: Salerno (Italy)
Has thanked: 77 times
Been thanked: 60 times
Contact:

Re: EXHAL

Postby RoccoMarco » Fri Oct 24, 2014 12:18 am

Hello.
soooo.... I have worked on "exhal" in my free time (given to me free from seasonal flu :?). I have changed it a little bit.
Now EXHAL support up to 3 accelrometer, 3 gyroscope and 3 magnetometer. The configuration is selectable in exhalconf.h.

For example about gyroscope

Code: Select all

/*===========================================================================*/
/* Gyroscope driver related settings.                                        */
/*===========================================================================*/
/**
 * @brief   Enables support for Gyroscopes over SPI.
 * @note    This options changes Gyroscope configuration structure.
 *
 */
#if !defined(GYRO_USE_SPI) || defined(__DOXYGEN__)
#define GYRO_USE_SPI                        TRUE
#endif

/**
 * @brief   Enables support for Gyroscopes over I2C.
 * @note    This options changes Gyroscope configuration structure.
 *
 */
#if !defined(GYRO_USE_I2C) || defined(__DOXYGEN__)
#define GYRO_USE_I2C                        FALSE
#endif

/**
 * @brief   Enables support for LSM303DLHC.
 * @note    This options changes Gyroscope configuration structure.
 *
 */
#if !defined(GYRO_USE_L3GD20) || defined(__DOXYGEN__)
#define GYRO_USE_L3GD20                     TRUE
#endif

/**
 * @brief   Chooses connection and device for every driver
 * @note    Supported connections are:
 *          GYRO_OVER_I2C
 *          GYRO_OVER_SPI
 *          GYRO_UNCONNECTED
 *
 *          Supported devices are:
 *          GYRO_USE_L3GD20
 *          GYRO_UNDEFINED
 */
#define GYROD1_CONN                         GYRO_OVER_SPI
#define GYROD2_CONN                         GYRO_UNCONNECTED
#define GYROD3_CONN                         GYRO_UNCONNECTED

#define GYROD1_DEV                          GYRO_USE_L3GD20
#define GYROD2_DEV                          GYRO_UNDEFINED
#define GYROD3_DEV                          GYRO_UNDEFINED


Since hardware depending parts are enclosed in some configuration structures, you can use EXHAL on different MCUs easily.

For example the accel config for F3 disco is:

Code: Select all

static const I2CConfig std_i2c_cfg = {
  STM32_TIMINGR_PRESC(15U) |
  STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) |
  STM32_TIMINGR_SCLH(15U)  | STM32_TIMINGR_SCLL(21U),
  0,
  0
};

static const LSM303DLHC_ACC_Config lsm303dlhc_acc_cfg = {
  LSM303DLHC_ACC_FS_2G,
  LSM303DLHC_ACC_PM_NORMAL,
  LSM303DLHC_ACC_ODR_400Hz,
  LSM303DLHC_ACC_AE_XYZ,
  LSM303DLHC_ACC_BDU_BLOCKED,
  LSM303DLHC_ACC_HR_Disabled
};

static const ACCELConfig acc_cfg = {
  &I2CD1,
  &std_i2c_cfg,
  &lsm303dlhc_acc_cfg
};


And for iNEMO is:

Code: Select all

static const I2CConfig std_i2c_cfg  = {
  OPMODE_I2C,
  400000,
  FAST_DUTY_CYCLE_2,
};

static const LSM303DLHC_AccConfig lsm303dlhc_acc_cfg = {
  LSM303DLHC_AccFS_2G,
  LSM303DLHC_AccPM_NORMAL,
  LSM303DLHC_AccODR_400HZ,
  LSM303DLHC_AccAE_XYZ,
  LSM303DLHC_AccBDU_BLOCKED,
  LSM303DLHC_AccHR_Disabled
};

static const ACCELEROMETER_Config acc_cfg= {
  &I2CD2,
  &std_i2c_cfg,
  &lsm303dlhc_acc_cfg
};


I will add more and more devices and I will add a data processing layer. So it will be independent from mems.

I know that it seems like a soup but it will be a collection of useful code that I have written along my embedded experience. I have lost too much time readapting old code for a new application.

Rocco Marco
Attachments
ARMCM4-STM32F3-EXHAL_00.7z
EXHAL 0.1.0 and STM32F3 demo
(26.07 KiB) Downloaded 131 times


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 2 guests