Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d296078
Adds debug messages in input
gregguche May 17, 2013
8894fbb
More debug in input.c
gregguche May 21, 2013
cc37b19
Added : content-length in doPostIn function
gregguche Jul 8, 2013
7feb5a0
Better fix for boundary matching
gregguche Jul 9, 2013
02e0bca
removed not needed modulo operation
gregguche Jul 10, 2013
b0bbb10
Fixed massive ack duplicates generation
Jul 11, 2013
30de2ac
elf loader application integration temporary commit
gregguche Aug 19, 2013
fc997d0
Fix rodata's issues, sections mismatch, elf application environment n…
gregguche Sep 11, 2013
ef0b12e
First complete application deployment, but output handlers are in RAM
gregguche Sep 17, 2013
e517383
Modified the elf environment generation, now works with multiple xmls
gregguche Sep 24, 2013
41d48c9
Fixed : in free_connection, coroutine in stack wasn't clear and lead …
gregguche Sep 30, 2013
b9b4055
little clean up
gregguche Sep 30, 2013
86fa4f2
added missing screenshot in doc
gregguche Oct 3, 2013
5bdb2bf
little clean up
gregguche Oct 4, 2013
c3a95ae
Modified sconscript sconstruct to name properly the final object file
gregguche Oct 10, 2013
2aaec64
fixed minor typo
gregguche Oct 10, 2013
412d5a4
Fixed bug on connection removal, issued from a bad add connection
gregguche Oct 10, 2013
0672270
Fix Allocator was not aligned on even addresses, leading to a relocat…
gregguche Oct 14, 2013
7de756c
cleanup
gregguche Oct 14, 2013
c74a42b
Fixed bug in url parsing when uploading the contacts book with the ur…
gregguche Oct 14, 2013
7482eff
better odd even test
gregguche Oct 14, 2013
a9f7bf2
typo
gregguche Oct 14, 2013
37417aa
Modified Now Smews resides at 0x10000 in flash, and let almost all 4k…
gregguche Oct 15, 2013
508f7b1
added missing link script file
gregguche Oct 15, 2013
127780c
Modified elf allocator ram size to 10 Kb
gregguche Oct 16, 2013
6b9017e
Modified symbols.c to upload time application
gregguche Oct 17, 2013
068961e
now resources_index is in eprom
gregguche Oct 21, 2013
9795484
Added data preservation on reset, now the data is saved in flash and …
gregguche Oct 29, 2013
8e50c79
Fix printf problem
gregguche Oct 30, 2013
e490934
WARNING this version doesn't work.
gregguche Oct 31, 2013
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
65 changes: 49 additions & 16 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ import os
import GenApps

# imports from SConstruct
Import('env libFileName elfFileName binDir coreDir driversDir genDir appBase toolsList chuncksNbits sourcesMap gzipped test')

Import('env libFileName elfFileName binDir coreDir driversDir genDir appBase toolsList chuncksNbits sourcesMap gzipped test dynApp dynamicAppName')
# returns the list of .c and .s files in dir, prefixed by dstDir
def getAllSourceFiles(dir, dstDir):
sourceFiles = []
Expand All @@ -53,9 +52,9 @@ def getAllSourceFiles(dir, dstDir):
# used to generate both static and dynamic resources
def generateResource(target, source, env):
if propsFilesMap.has_key(str(source[0])):
GenApps.generateResource(str(source[0]),str(target[0]),chuncksNbits,gzipped,propsFilesMap[str(source[0])])
GenApps.generateResource(str(source[0]),str(target[0]), chuncksNbits,gzipped,propsFilesMap[str(source[0])])
else:
GenApps.generateResource(str(source[0]),str(target[0]),chuncksNbits,gzipped,None)
GenApps.generateResource(str(source[0]),str(target[0]), chuncksNbits,gzipped,None)
return None

# builder used to generate the file index, with the URLs tree
Expand Down Expand Up @@ -102,10 +101,13 @@ VariantDir(os.path.join(binDir,'drivers'), driversDir, duplicate=0)
# applications files index and channel files settings
resourcesIndexO = os.path.join(binDir,'gen','resources_index')
resourcesIndexC = os.path.join(genDir,'resources_index.c')
elfEnvironmentO = os.path.join(binDir,'gen','elf_environment')
elfEnvironmentC = os.path.join(genDir,'elf_environment.c')
channelsH = os.path.join(genDir,'channels.h')
appListName = os.path.join(genDir,'appList')
definesH = os.path.join(genDir,'defines.h')
blobsH = os.path.join(genDir,'blobs.h')

# loop on each web resource in order to generate associated c files
# static resources generate pre-computed c files
# dynamic resources are enriched with new declarations (from their XML)
Expand Down Expand Up @@ -156,16 +158,47 @@ env.GenChannelsH(channelsH,propsFilesList)
env.Depends(channelsH,toolsList)
env.GenDefinesH(definesH,[])
env.GenBlobsH(blobsH,[])
# engine source code dependencies
coreFiles = getAllSourceFiles(coreDir, os.path.join(binDir,'core'))
# target drivers source code dependencies
targetFiles = getAllSourceFiles(driversDir, os.path.join(binDir,'drivers'))
# create a library from all sources
lib = env.Library(libFileName, targetFiles + coreFiles + genObjects)
# link the library into a elf file
if env['BUILDERS']['Program'] is not None:
final = env.Program(elfFileName, targetFiles + coreFiles + genObjects)
if dynApp :

installList = []
removeList = []
for file in sourcesMap.keys():
if file.endswith('.h') or file.endswith('.c'):
GenApps.extractXMLElfApplicationLifeCycle(file, installList, removeList)

# elf application environment generation
GenApps.generateElfApplication(elfEnvironmentC, installList, removeList)
# elf application environment object file
genObjects.append(env.Object(elfEnvironmentO, elfEnvironmentC))

linkerCommand = env.subst('$LINK')
linkerCommand += ' -r '

pathes = []
for elt in genObjects :
for inner_elt in elt.data :
pathes.append(inner_elt.path)
linkerCommand += ' '.join(pathes)
linkerCommand += ' -o $TARGET'

finalDynamicAppName = os.path.join(binDir, dynamicAppName + '.o')

env.Command(finalDynamicAppName, None, linkerCommand)

for elt in genObjects :
for inner_elt in elt.data :
env.Depends(finalDynamicAppName, inner_elt.path)
else:
final = None
# clean
Clean([lib,final],[binDir,genDir])
# engine source code dependencies
coreFiles = getAllSourceFiles(coreDir, os.path.join(binDir,'core'))
# target drivers source code dependencies
targetFiles = getAllSourceFiles(driversDir, os.path.join(binDir,'drivers'))
# create a library from all sources
lib = env.Library(libFileName, targetFiles + coreFiles + genObjects)
# link the library into a elf file
if env['BUILDERS']['Program'] is not None:
final = env.Program(elfFileName, targetFiles + coreFiles + genObjects)
else:
final = None
# clean
Clean([lib,final],[binDir,genDir])
25 changes: 22 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ opts.Add(BoolVariable('gzip', 'Set to 1 to gzip (at compile time) static Web res
opts.Add(BoolVariable('debug', 'Set to 1 to build for debug', False))
opts.Add(BoolVariable('sdump', 'Set to 1 to include stack dump', False))
opts.Add(BoolVariable('test', 'Set to 1 to test the test apps', False))
opts.Add(BoolVariable('dynApp', 'Set to 1 to build an uploadable application', False))
opts.Add('ipaddr', 'Set the IP address of Smews', None)
# the list of disableable options
disabledHash = {}
Expand All @@ -97,6 +98,7 @@ globalEnv = Environment(tools = ['gcc','as','ar','gnulink'], ENV = os.environ, o
Help(opts.GenerateHelpText(globalEnv))

# arguments are stored into variables
dynApp = globalEnv['dynApp']
gzipped = globalEnv['gzip']
debug = globalEnv['debug']
sdump = globalEnv['sdump']
Expand Down Expand Up @@ -159,6 +161,7 @@ if len(targets) == 0:
# will generate :
# / -> smews, myApp/ -> myApplication, test/ -> test
appDirs = originalAppDirs.split(',')

dirsMap = {}
for appDir in set(appDirs + [httpCodesDir]):
if appDir != '':
Expand All @@ -168,6 +171,18 @@ for appDir in set(appDirs + [httpCodesDir]):
else:
dirsMap[appDir] = '/' + appDir

dynamicAppName = ''
if dynApp :
appDirNames = []
for appDir in appDirs:
if appDir != '':
idx = appDir.find(':')
if idx != -1:
appDirNames.append(appDir[idx+1:])
else:
appDirNames.append(appDir)
dynamicAppName = '_'.join(appDirNames)

# association between web applicative resources and their final URLs
# appDir did only contain association of embedded applications
# here, we retrieve all the files of each application
Expand All @@ -185,14 +200,18 @@ for appDir in dirsMap.keys():
globalEnv.Replace(CC = 'gcc')
globalEnv.Replace(AS = 'as')
globalEnv.Replace(AR = 'ar')
globalEnv.Replace(LINK = 'ld')
globalEnv.Append(CCFLAGS = '-Wall')
if sdump:
globalEnv.Append(CCFLAGS = '-DSTACK_DUMP')
if debug:
globalEnv.Append(CCFLAGS = '-O0 -g')
else:
globalEnv.Append(CCFLAGS = '-Os -ffunction-sections -fdata-sections -fno-strict-aliasing')
globalEnv.Append(LINKFLAGS = '-Wl,--gc-sections -Wl,--print-gc-sections')
if dynApp :
globalEnv.Append(CCFLAGS = '-Os -fno-strict-aliasing')
else :
globalEnv.Append(CCFLAGS = '-Os -ffunction-sections -fdata-sections -fno-strict-aliasing')
globalEnv.Append(LINKFLAGS = '--gc-sections --print-gc-sections')
globalEnv.Append(CPPDEFINES = {'CHUNCKS_NBITS' : str(chuncksNbits)})
for func in toDisable:
globalEnv.Append(CPPDEFINES = { disabledHash[func] : '1'})
Expand Down Expand Up @@ -224,7 +243,7 @@ for target in targets:
os.mkdir(dir)

# export variables for external SConscript files
Export('env libFileName elfFileName binDir coreDir driversDir genDir appBase toolsList chuncksNbits sourcesMap gzipped test')
Export('env libFileName elfFileName binDir coreDir driversDir genDir appBase toolsList chuncksNbits sourcesMap gzipped test dynApp dynamicAppName')
Export('env targetDir binDir projectName elfName')
Export('dirsMap sourcesMap target sconsBasePath httpCodesDir tmpBase')
# target dependent SConscript call
Expand Down
1 change: 1 addition & 0 deletions apps/connectionsStats/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ static char doGet(struct args_t *args) {
out_str("NULL\n");
out_str("\tsomething to send: "); out_uint(something_to_send(conn)); out_str("\n");
})

return 1;
}
4 changes: 2 additions & 2 deletions apps/contactsBook/cb_add.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/*
<generator>
<handlers doGet="doGet"/>
<handlers doGet="doGetAdd"/>
<properties persistence="persistent"/>
<args>
<arg name="id" type="uint8" />
Expand All @@ -47,7 +47,7 @@

#include "cb_shared.h"

static char doGet(struct args_t *args) {
static char doGetAdd(struct args_t *args) {
unsigned char id = 0;
uint16_t n = CONST_UI16(n_contacts);
if(args && args->num < 5) {
Expand Down
6 changes: 2 additions & 4 deletions apps/contactsBook/cb_get.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

/*
<generator>
<handlers doGet="doGet"/>
<handlers doGet="doGetContacts"/>
<properties persistence="idempotent"/>
</generator>
*/
Expand Down Expand Up @@ -65,10 +65,9 @@ static void out_const_str(const unsigned char /*CONST_VAR*/ *str) {
}
}

static char doGet(struct args_t *args) {
static char doGetContacts(struct args_t *args) {
uint16_t i = 0;
uint16_t n = CONST_UI16(n_contacts);

out_const_str(str0);

for(i=0; i<n; i++) {
Expand All @@ -84,6 +83,5 @@ static char doGet(struct args_t *args) {
}

out_const_str(str5);

return 1;
}
Loading