Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Miosix Kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Miosix Kernel
Commits
ea9118f2
Commit
ea9118f2
authored
6 years ago
by
Luca Erbetta
Browse files
Options
Downloads
Patches
Plain Diff
revert clang-format
parent
23beab74
No related branches found
Tags
Tags containing commit
1 merge request
!39
Draft: Compute unit v2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rogallina/interfaces-impl/bsp.cpp
+135
-144
135 additions, 144 deletions
...2f4/stm32f429zi_skyward_rogallina/interfaces-impl/bsp.cpp
with
135 additions
and
144 deletions
miosix/arch/cortexM4_stm32f4/stm32f429zi_skyward_rogallina/interfaces-impl/bsp.cpp
+
135
−
144
View file @
ea9118f2
...
@@ -30,26 +30,25 @@
...
@@ -30,26 +30,25 @@
* Board support package, this file initializes hardware.
* Board support package, this file initializes hardware.
************************************************************************/
************************************************************************/
#include
"interfaces/bsp.h"
#include
<cstdlib>
#include
<inttypes.h>
#include
<inttypes.h>
#include
<sys/ioctl.h>
#include
<sys/ioctl.h>
#include
<cstdlib>
#include
"interfaces/bsp.h"
#include
"board_settings.h"
#include
"kernel/kernel.h"
#include
"config/miosix_settings.h"
#include
"kernel/sync.h"
#include
"drivers/sd_stm32f2_f4.h"
#include
"drivers/serial.h"
#include
"filesystem/console/console_device.h"
#include
"filesystem/file_access.h"
#include
"interfaces/arch_registers.h"
#include
"interfaces/delays.h"
#include
"interfaces/delays.h"
#include
"interfaces/portability.h"
#include
"interfaces/portability.h"
#include
"kernel/kernel.h"
#include
"interfaces/arch_registers.h"
#include
"config/miosix_settings.h"
#include
"kernel/logging.h"
#include
"kernel/logging.h"
#include
"kernel/sync.h"
#include
"filesystem/file_access.h"
#include
"filesystem/console/console_device.h"
#include
"drivers/serial.h"
#include
"drivers/sd_stm32f2_f4.h"
#include
"board_settings.h"
// #include "kernel/IRQDisplayPrint.h"
// #include "kernel/IRQDisplayPrint.h"
namespace
miosix
namespace
miosix
{
{
//
//
// Initialization
// Initialization
...
@@ -62,8 +61,7 @@ namespace miosix
...
@@ -62,8 +61,7 @@ namespace miosix
static
void
sdramCommandWait
()
static
void
sdramCommandWait
()
{
{
for
(
int
i
=
0
;
i
<
0xffff
;
i
++
)
for
(
int
i
=
0
;
i
<
0xffff
;
i
++
)
if
((
FMC_Bank5_6
->
SDSR
&
FMC_SDSR_BUSY
)
==
0
)
if
((
FMC_Bank5_6
->
SDSR
&
FMC_SDSR_BUSY
)
==
0
)
return
;
return
;
}
}
void
configureSdram
()
void
configureSdram
()
...
@@ -95,8 +93,7 @@ void configureSdram()
...
@@ -95,8 +93,7 @@ void configureSdram()
GPIOG
->
MODER
=
0x80020a0a
;
GPIOG
->
MODER
=
0x80020a0a
;
GPIOA
->
OSPEEDR
=
0xaaaaaaaa
;
//Default to 50MHz speed for all GPIOs...
GPIOA
->
OSPEEDR
=
0xaaaaaaaa
;
//Default to 50MHz speed for all GPIOs...
GPIOB
->
OSPEEDR
=
GPIOB
->
OSPEEDR
=
0xaaaaaaaa
|
0x00003c00
;
//...but 100MHz for the SDRAM pins
0xaaaaaaaa
|
0x00003c00
;
//...but 100MHz for the SDRAM pins
GPIOC
->
OSPEEDR
=
0xaaaaaaaa
|
0x00000003
;
GPIOC
->
OSPEEDR
=
0xaaaaaaaa
|
0x00000003
;
GPIOD
->
OSPEEDR
=
0xaaaaaaaa
|
0xf03f000f
;
GPIOD
->
OSPEEDR
=
0xaaaaaaaa
|
0xf03f000f
;
GPIOE
->
OSPEEDR
=
0xaaaaaaaa
|
0xffffc00f
;
GPIOE
->
OSPEEDR
=
0xaaaaaaaa
|
0xffffc00f
;
...
@@ -122,8 +119,7 @@ void configureSdram()
...
@@ -122,8 +119,7 @@ void configureSdram()
|
FMC_SDCR1_NR_0
// 12 bit row address
|
FMC_SDCR1_NR_0
// 12 bit row address
|
FMC_SDCR1_MWID_0
// 16 bit data bus
|
FMC_SDCR1_MWID_0
// 16 bit data bus
|
FMC_SDCR1_NB
// 4 banks
|
FMC_SDCR1_NB
// 4 banks
|
|
FMC_SDCR1_CAS_1
;
// 2 cycle CAS latency (F<133MHz)
FMC_SDCR1_CAS_1
;
// 2 cycle CAS latency (F<133MHz)
#ifdef SYSCLK_FREQ_180MHz
#ifdef SYSCLK_FREQ_180MHz
//One SDRAM clock cycle is 11.1ns
//One SDRAM clock cycle is 11.1ns
...
@@ -201,10 +197,9 @@ void IRQbspInit()
...
@@ -201,10 +197,9 @@ void IRQbspInit()
ledOn
();
ledOn
();
delayMs
(
100
);
delayMs
(
100
);
ledOff
();
ledOff
();
DefaultConsole
::
instance
().
IRQset
(
intrusive_ref_ptr
<
Device
>
(
new
STM32Serial
(
DefaultConsole
::
instance
().
IRQset
(
intrusive_ref_ptr
<
Device
>
(
defaultSerial
,
defaultSerialSpeed
,
defaultSerialFlowctrl
new
STM32Serial
(
defaultSerial
,
defaultSerialSpeed
,
?
STM32Serial
::
RTSCTS
defaultSerialFlowctrl
?
STM32Serial
::
RTSCTS
:
STM32Serial
::
NOFLOWCTRL
)));
:
STM32Serial
::
NOFLOWCTRL
)));
// irq_display = new IRQDisplayPrint();
// irq_display = new IRQDisplayPrint();
// DefaultConsole::instance().IRQset(intrusive_ref_ptr<Device>(irq_display));
// DefaultConsole::instance().IRQset(intrusive_ref_ptr<Device>(irq_display));
}
}
...
@@ -219,7 +214,6 @@ void IRQbspInit()
...
@@ -219,7 +214,6 @@ void IRQbspInit()
void
bspInit2
()
void
bspInit2
()
{
{
#ifdef WITH_FILESYSTEM
#ifdef WITH_FILESYSTEM
auto
tx
=
Gpio
<
GPIOC_BASE
,
10
>::
getPin
();
auto
tx
=
Gpio
<
GPIOC_BASE
,
10
>::
getPin
();
tx
.
alternateFunction
(
7
);
tx
.
alternateFunction
(
7
);
auto
rx
=
Gpio
<
GPIOC_BASE
,
11
>::
getPin
();
auto
rx
=
Gpio
<
GPIOC_BASE
,
11
>::
getPin
();
...
@@ -229,7 +223,6 @@ void bspInit2()
...
@@ -229,7 +223,6 @@ void bspInit2()
basicFilesystemSetup
(
SDIODriver
::
instance
());
basicFilesystemSetup
(
SDIODriver
::
instance
());
devFs
->
addDevice
(
devFs
->
addDevice
(
"gps"
,
intrusive_ref_ptr
<
Device
>
(
new
STM32Serial
(
3
,
115200
,
tx
,
rx
)));
"gps"
,
intrusive_ref_ptr
<
Device
>
(
new
STM32Serial
(
3
,
115200
,
tx
,
rx
)));
#endif //WITH_FILESYSTEM
#endif //WITH_FILESYSTEM
// Thread::create(printIRQ, 2048);
// Thread::create(printIRQ, 2048);
}
}
...
@@ -247,8 +240,7 @@ WARNING: close all files before using this function, since it unmounts the
...
@@ -247,8 +240,7 @@ WARNING: close all files before using this function, since it unmounts the
filesystem.<br>
filesystem.<br>
When in shutdown mode, power consumption of the miosix board is reduced to ~
When in shutdown mode, power consumption of the miosix board is reduced to ~
5uA??, however, true power consumption depends on what is connected to the GPIO
5uA??, however, true power consumption depends on what is connected to the GPIO
pins. The user is responsible to put the devices connected to the GPIO pin in
pins. The user is responsible to put the devices connected to the GPIO pin in the
the
minimal power consumption mode before calling shutdown(). Please note that to
minimal power consumption mode before calling shutdown(). Please note that to
minimize power consumption all unused GPIO must not be left floating.
minimize power consumption all unused GPIO must not be left floating.
*/
*/
...
@@ -262,8 +254,7 @@ void shutdown()
...
@@ -262,8 +254,7 @@ void shutdown()
disableInterrupts
();
disableInterrupts
();
for
(;;)
for
(;;)
;
;
}
}
void
reboot
()
void
reboot
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment