How to create a custom board project?
Moderators: RoccoMarco, barthess
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: How to create a custom board project?
Ciao,
Usually it is an input with or without pull resistor.
Usually it is an input with or without pull resistor.
Ciao,
RM
RM
- Chudik
- Posts: 152
- Joined: Fri Jan 16, 2015 7:51 am
- Location: California
- Has thanked: 7 times
- Been thanked: 1 time
Re: How to create a custom board project?
I.e. need define as input and assign it to EXTI in code, correct?
I'm trying manually translate all my settings I did in CubeMX reference project, and in that program you define that pin as external interrupt, not as input. Obviously it becomes an input, but not defined so when CubeMX generates the code.
I'm trying manually translate all my settings I did in CubeMX reference project, and in that program you define that pin as external interrupt, not as input. Obviously it becomes an input, but not defined so when CubeMX generates the code.
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: How to create a custom board project?
EXTI driver is able to detect a logic level transition on a certain pin. Set a pin as input then start EXTI with a proper configuration.
In the configuration you have to choose the mode for each exti line and a callback which will be launched on the transition.
As example STM32F3
This configuration detects both high to low and low to high transition on EXTI line 0. Note that on exti line 0 there are PA0, PB0, PC0 connected through a multiplexer.
This configuration chooses PA0. Autostarted means that after extStart the driver is already "listening". extcb1 is the pointer to the function which is launched when an edge is detected.
You can found bunches of demos like this under testhal.
By the way, I heard that Giovanni has integrated ext in pal. I am currently out of date about this. Anyway, EXT APIs are still supported.
Ciao.
In the configuration you have to choose the mode for each exti line and a callback which will be launched on the transition.
As example STM32F3
Code: Select all
static const EXTConfig extcfg = {
{
{EXT_CH_MODE_BOTH_EDGES | EXT_CH_MODE_AUTOSTART | EXT_MODE_GPIOA, extcb1},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL},
{EXT_CH_MODE_DISABLED, NULL}
}
};
This configuration detects both high to low and low to high transition on EXTI line 0. Note that on exti line 0 there are PA0, PB0, PC0 connected through a multiplexer.
This configuration chooses PA0. Autostarted means that after extStart the driver is already "listening". extcb1 is the pointer to the function which is launched when an edge is detected.
You can found bunches of demos like this under testhal.
By the way, I heard that Giovanni has integrated ext in pal. I am currently out of date about this. Anyway, EXT APIs are still supported.
Ciao.
Ciao,
RM
RM
- Chudik
- Posts: 152
- Joined: Fri Jan 16, 2015 7:51 am
- Location: California
- Has thanked: 7 times
- Been thanked: 1 time
Re: How to create a custom board project?
Note that on exti line 0 there are PA0, PB0, PC0 connected through a multiplexer.
Yes, I know that
I'm going to use PD2 for EXTI2.
I heard that Giovanni has integrated ext in pal
Hmm, that would be interesting.
Thanks
- Chudik
- Posts: 152
- Joined: Fri Jan 16, 2015 7:51 am
- Location: California
- Has thanked: 7 times
- Been thanked: 1 time
Re: How to create a custom board project?
Project compilation after creating the custom board gives errors
With Nucleo board I had no such problem.
What could it be? Which way to dig?
Code: Select all
Description Resource Path Location Type
Field 'p_newer' could not be resolved chsys.c /FW-0134_CHM3/os/os/rt/src line 276 Semantic Error
Field 'p_next' could not be resolved chsys.c /FW-0134_CHM3/os/os/rt/src line 223 Semantic Error
Field 'p_next' could not be resolved chsys.c /FW-0134_CHM3/os/os/rt/src line 226 Semantic Error
Field 'p_older' could not be resolved chsys.c /FW-0134_CHM3/os/os/rt/src line 283 Semantic Error
Field 'p_prev' could not be resolved chsys.c /FW-0134_CHM3/os/os/rt/src line 230 Semantic Error
Field 'p_prev' could not be resolved chsys.c /FW-0134_CHM3/os/os/rt/src line 233 Semantic Error
Field 'p_state' could not be resolved chsys.c /FW-0134_CHM3/os/os/rt/src line 125 Semantic Error
With Nucleo board I had no such problem.
What could it be? Which way to dig?
- 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: How to create a custom board project?
Probably you are mixing RT3 and RT4 stuff, in RT4 field names lost the p_ prefix.
Giovanni
Giovanni
- Chudik
- Posts: 152
- Joined: Fri Jan 16, 2015 7:51 am
- Location: California
- Has thanked: 7 times
- Been thanked: 1 time
Re: How to create a custom board project?
I don't know what is RT3 anв RT4 How to check it?
I just transfered my project from Nucleo to custom board keeping all environment as same as possible. Different pinout and set of interfaces, of course.
Eith Nucleo board RT + shell worked ok and I decided to transfer it to the custom board at this step, before adding all the other stuff.
I just transfered my project from Nucleo to custom board keeping all environment as same as possible. Different pinout and set of interfaces, of course.
Eith Nucleo board RT + shell worked ok and I decided to transfer it to the custom board at this step, before adding all the other stuff.
- 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: How to create a custom board project?
ChibiOS/RT 3.x and ChibiOS/RT 4.x.
3.x is in the stable 16.1.x version, RT4 is the version in trunk.
Giovanni
3.x is in the stable 16.1.x version, RT4 is the version in trunk.
Giovanni
- Chudik
- Posts: 152
- Joined: Fri Jan 16, 2015 7:51 am
- Location: California
- Has thanked: 7 times
- Been thanked: 1 time
Re: How to create a custom board project?
I did not download RT4.
I'm using the same set of files for chibios 1.61 located at the same place under Chiibistudio. I even had to create directory in the same place as all the other boards located (usually I try to not change "parent" set of files and directories), otherwise it lost some paths
I'm using the same set of files for chibios 1.61 located at the same place under Chiibistudio. I even had to create directory in the same place as all the other boards located (usually I try to not change "parent" set of files and directories), otherwise it lost some paths
Who is online
Users browsing this forum: Google [Bot] and 42 guests