Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FW-760: Mimsy2 BSP #423

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ if env['noadaptivesync']==1:
env.Append(CPPDEFINES = 'NOADAPTIVESYNC')
if env['l2_security']==1:
env.Append(CPPDEFINES = 'L2_SECURITY_ACTIVE')
if env['printf']==1:
env.Append(CPPDEFINES = 'OPENSERIAL_PRINTF')
#if env['printf']==1:
# env.Append(CPPDEFINES = 'OPENSERIAL_PRINTF')
if env['deadline_option']==1:
env.Append(CPPDEFINES = 'DEADLINE_OPTION_ENABLED')

Expand Down Expand Up @@ -167,7 +167,7 @@ elif env['toolchain']=='iar':

elif env['toolchain']=='iar-proj':

if env['board'] not in ['telosb','gina','wsn430v13b','wsn430v14','z1','openmotestm','agilefox','openmote-cc2538','openmote-b','iot-lab_M3']:
if env['board'] not in ['telosb','gina','wsn430v13b','wsn430v14','z1','openmotestm','agilefox','openmote-cc2538','mimsy2-cc2538','openmote-b','iot-lab_M3']:
raise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))

env['IAR_EW430_INSTALLDIR'] = os.environ['IAR_EW430_INSTALLDIR']
Expand Down Expand Up @@ -197,10 +197,10 @@ elif env['toolchain']=='iar-proj':

elif env['toolchain']=='armgcc':

if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','openmote-b','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro']:
if env['board'] not in ['silabs-ezr32wg','openmote-cc2538','mimsy2-cc2538','openmote-b','iot-lab_M3','iot-lab_A8-M3','openmotestm', 'samr21_xpro']:
raise SystemError('toolchain {0} can not be used for board {1}'.format(env['toolchain'],env['board']))

if env['board'] in ['openmote-cc2538','openmote-b']:
if env['board'] in ['openmote-cc2538','openmote-b','mimsy2-cc2538']:
if env['revision'] == "A1":
linker_file = 'cc2538sf23.lds'
print "*** OPENMOTE CC2538 REV. A1 ***\n"
Expand All @@ -218,6 +218,7 @@ elif env['toolchain']=='armgcc':
env.Append(CCFLAGS = '-mthumb')
env.Append(CCFLAGS = '-g3')
env.Append(CCFLAGS = '-Wstrict-prototypes')

if env['revision'] == "A1":
env.Append(CCFLAGS = '-DREVA1=1')

Expand All @@ -230,10 +231,13 @@ elif env['toolchain']=='armgcc':
# linker
env.Append(LINKFLAGS = '-Tbsp/boards/'+env['board']+'/' + linker_file)
env.Append(LINKFLAGS = '-nostartfiles')

env.Append(LINKFLAGS = '-Wl,-Map,${TARGET.base}.map')
env.Append(LINKFLAGS = '-mcpu=cortex-m3')
env.Append(LINKFLAGS = '-mthumb')
env.Append(LINKFLAGS = '-g3')


if env['revision'] == "A1":
env.Append(LINKFLAGS = '-DREVA1=1')

Expand Down Expand Up @@ -734,7 +738,7 @@ def BootloadFunc():
suffix = '.phonyupload',
src_suffix = '.ihex',
)
elif env['board'] in ['openmote-cc2538','openmote-b'] :
elif env['board'] in ['openmote-cc2538','openmote-b','mimsy2-cc2538'] :
return Builder(
action = OpenMoteCC2538_bootload,
suffix = '.phonyupload',
Expand Down Expand Up @@ -779,7 +783,7 @@ def buildLibs(projectDir):
'00std': [ ],
'01bsp': [ 'libbsp'],
'02drv': [ 'libkernel','libdrivers','libbsp'],
'03oos': ['libopenstack','libopenapps','libopenstack','libkernel','libdrivers','libbsp'], # this order needed for mspgcc
'03oos': ['libm','libopenstack','libopenapps','libopenstack','libkernel','libdrivers','libbsp'], # this order needed for mspgcc
}

returnVal = None
Expand Down Expand Up @@ -866,6 +870,7 @@ def project_finder(localEnv):
source = source,
LIBS = libs,
)

targetAction = localEnv.PostBuildExtras(exe)

Alias(targetName, [targetAction])
Expand Down Expand Up @@ -1054,3 +1059,6 @@ buildEnv.SConscript(
exports = {'env': buildEnv},
variant_dir = projectsVarDir,
)


buildEnv.Append(LIBS = "libm")
15 changes: 3 additions & 12 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ project:
openstack/02a-MAClow/topology.c file.
noadaptivesync Do not use adaptive synchronization.
l2_security Use hop-by-hop encryption and authentication.
0 (off), 1 (on)
printf Sends the string messages to openvisualizer
0 (off ), 1 (on, default)
0 (off), 1 (on)
ide qtcreator

Common variables:
Expand Down Expand Up @@ -108,6 +106,7 @@ command_line_options = {
'z1',
# Cortex-M3
'openmote-cc2538',
'mimsy2-cc2538',
'openmote-b',
'silabs-ezr32wg',
'openmotestm',
Expand Down Expand Up @@ -139,8 +138,7 @@ command_line_options = {
'forcetopology': ['0','1'],
'debug': ['0','1'],
'noadaptivesync': ['0','1'],
'l2_security': ['0','1'],
'printf': ['1','0'], # 1=on (default), 0=off
'l2_security': ['0','1'],
'deadline_option': ['0','1'],
'ide': ['none','qtcreator'],
'revision': ['']
Expand Down Expand Up @@ -287,13 +285,6 @@ command_line_vars.AddVariables(
command_line_options['l2_security'][0], # default
validate_option, # validator
int, # converter
),
(
'printf', # key
'', # help
command_line_options['printf'][0], # default
validate_option, # validator
int, # converter
),
(
'deadline_option', # key
Expand Down
7 changes: 7 additions & 0 deletions bsp/boards/mimsy2-cc2538/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
The OpenWSN BSP (Board Support Package) for the CC2538 platform is based on the
CC2538 Foundation Firmware provided by Texas Instruments (available at:
http://www.ti.com/tool/cc2538-sw). The current version of the CC2538 Foundation
Firmware is Rev. A which dates from May 6, 2013. Information regarding the
CC2538 Foundation Firmware can be found in the CC2538 Peripheral Driver Library
User's Guide (available at: http://www.ti.com/lit/pdf/swru325) which also
dates from May 6, 2013.
42 changes: 42 additions & 0 deletions bsp/boards/mimsy2-cc2538/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import os

Import('env')

localEnv = env.Clone()

adxl346 = localEnv.SConscript(
os.path.join('#','bsp','chips','adxl346','SConscript'),
variant_dir = 'adxl346',
exports = {'env': env},
)

max44009 = localEnv.SConscript(
os.path.join('#','bsp','chips','max44009','SConscript'),
variant_dir = 'max44009',
exports = {'env': env},
)

sht21 = localEnv.SConscript(
os.path.join('#','bsp','chips','sht21','SConscript'),
variant_dir = 'sht21',
exports = {'env': env},
)

source = \
[file for file in Glob('*.c') if file.name.find('iar')==-1] + \
Glob('source/*.c')

localEnv.Append(
CPPPATH = [
os.path.join('#','bsp','boards','openmote-cc2538'),
os.path.join('#','bsp','boards','openmote-cc2538','headers'),
os.path.join('#','bsp','boards','openmote-cc2538','source'),
os.path.join('#','bsp','chips','adxl346'),
os.path.join('#','bsp','chips','max44009'),
os.path.join('#','bsp','chips','sht21'),
],
)

board = localEnv.Object(source=source) + adxl346 + max44009 + sht21

Return('board')
38 changes: 38 additions & 0 deletions bsp/boards/mimsy2-cc2538/accel_auto_cal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
$License:
Copyright (C) 2011-2012 InvenSense Corporation, All Rights Reserved.
See included License.txt for License information.
$
*/

/*******************************************************************************
*
* $Id$
*
******************************************************************************/

#ifndef MLDMP_ACCEL_AUTO_CALIBRATION_H__
#define MLDMP_ACCEL_AUTO_CALIBRATION_H__

#include "mltypes.h"

#ifdef __cplusplus
extern "C" {
#endif

inv_error_t inv_enable_in_use_auto_calibration(void);
inv_error_t inv_disable_in_use_auto_calibration(void);
inv_error_t inv_stop_in_use_auto_calibration(void);
inv_error_t inv_start_in_use_auto_calibration(void);
inv_error_t inv_in_use_auto_calibration_is_enabled(unsigned char *is_enabled);
inv_error_t inv_init_in_use_auto_calibration(void);
void inv_init_accel_maxmin(void);
void inv_record_good_accel_maxmin(void);
int inv_get_accel_bias_stage(void);

#ifdef __cplusplus
}
#endif

#endif // MLDMP_ACCEL_AUTO_CALIBRATION_H__

Loading