Skip to content

Commit

Permalink
added ISO1 instead of ISO2. This compiles and fits into memory. Still…
Browse files Browse the repository at this point in the history
… untested.
  • Loading branch information
uhi22 committed May 11, 2024
1 parent 76f3c1e commit b3b9da2
Show file tree
Hide file tree
Showing 17 changed files with 39,579 additions and 230 deletions.
16 changes: 13 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,26 +33,36 @@ CFLAGS = -Os -Iinclude/ -Ilibopeninv/include -Ilibopencm3/include -Iexi -Iccs \
CPPFLAGS = -Og -ggdb -Wall -Wextra -Iinclude/ -Ilibopeninv/include -Ilibopencm3/include -Iexi -Iccs \
-fno-common -std=c++11 -pedantic -DSTM32F1 -DUSART_BAUDRATE=921600 \
-ffunction-sections -fdata-sections -fno-builtin -fno-rtti -fno-exceptions -fno-unwind-tables -mcpu=cortex-m3 -mthumb
# Here we configure some compile-time features of the software:
CONFIGURATIONFLAGS = -DUSE_ISO1 -DUSE_SAME_DOC_FOR_ENCODER_AND_DECODER

# Check if the variable GITHUB_RUN_NUMBER exists. When running on the github actions running, this
# variable is automatically available.
# Create a compiler define with the content of the variable. Or, if it does not exist, use replacement value 0.
EXTRACOMPILERFLAGS = $(shell \
if [ -z "$$GITHUB_RUN_NUMBER" ]; then echo "-DGITHUB_RUN_NUMBER=0"; else echo "-DGITHUB_RUN_NUMBER=$$GITHUB_RUN_NUMBER"; fi \
)

# For testing what causes the out-of-memory, we can use a linker file with a big memory:
#LDSCRIPT = linkerBigForTestOnly.ld
# The original for the STM32RET with the correct memory sizes:
LDSCRIPT = linker.ld

LDFLAGS = -Llibopencm3/lib -T$(LDSCRIPT) -march=armv7 -nostartfiles -Wl,--gc-sections,-Map,linker.map
OBJSL = main.o hwinit.o stm32scheduler.o params.o terminal.o terminal_prj.o \
my_string.o digio.o my_fp.o printf.o anain.o \
param_save.o errormessage.o stm32_can.o canhardware.o canmap.o cansdo.o \
picontroller.o terminalcommands.o \
ipv6.o tcp.o \
connMgr.o modemFinder.o pevStateMachine.o pevStateMachineISO2.o temperatures.o proximitypilot.o acOBC.o \
connMgr.o modemFinder.o \
pevStateMachine.o pevStateMachineISO1.o pevStateMachineISO2.o\
temperatures.o proximitypilot.o acOBC.o \
hardwareInterface.o hardwareVariants.o pushbutton.o udpChecksum.o \
homeplug.o myHelpers.o qca7000.o \
appHandEXIDatatypesDecoder.o ByteStream.o EncoderChannel.o \
appHandEXIDatatypesEncoder.o DecoderChannel.o EXIHeaderDecoder.o \
appHandEXIDatatypes.o dinEXIDatatypesDecoder.o EXIHeaderEncoder.o \
iso1EXIDatatypesDecoder.o iso1EXIDatatypesEncoder.o iso1EXIDatatypes.o \
iso2EXIDatatypesDecoder.o iso2EXIDatatypesEncoder.o iso2EXIDatatypes.o \
BitInputStream.o dinEXIDatatypesEncoder.o MethodsBag.o \
BitOutputStream.o dinEXIDatatypes.o projectExiConnector.o
Expand Down Expand Up @@ -117,11 +127,11 @@ $(BINARY): $(OBJS) $(LDSCRIPT)

$(OUT_DIR)/%.o: %.c Makefile
@printf " CC $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
$(Q)$(CC) $(CFLAGS) $(CONFIGURATIONFLAGS) -MMD -MP -o $@ -c $<

$(OUT_DIR)/%.o: %.cpp Makefile
@printf " CPP $(subst $(shell pwd)/,,$(@))\n"
$(Q)$(CPP) $(CPPFLAGS) $(EXTRACOMPILERFLAGS) -MMD -MP -o $@ -c $<
$(Q)$(CPP) $(CPPFLAGS) $(EXTRACOMPILERFLAGS) $(CONFIGURATIONFLAGS) -MMD -MP -o $@ -c $<

clean:
@printf " CLEAN ${OUT_DIR}\n"
Expand Down
1 change: 1 addition & 0 deletions ccs/ccs32_globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "modemFinder.h"
#include "myHelpers.h"
#include "pevStateMachine.h"
#include "pevStateMachineISO1.h"
#include "pevStateMachineISO2.h"
#include "qca7000.h"
#include "tcp.h"
Expand Down
252 changes: 149 additions & 103 deletions ccs/pevStateMachine.cpp

Large diffs are not rendered by default.

1,038 changes: 1,038 additions & 0 deletions ccs/pevStateMachineISO1.cpp

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions ccs/pevStateMachineISO1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* Interface header for pevStateMachine.c */

/* Global Defines */

#define V2GTP_HEADER_SIZE 8 /* The V2GTP header has 8 bytes */
#define MAX_LABEL_LEN 25

/* Global Variables */
extern const char pevSttLabelsIso1[][MAX_LABEL_LEN];

/* Global Functions */
#ifdef __cplusplus
extern "C" {
#endif
/* pev state machine for ISO */
extern void pevStateMachineISO1_Mainfunction(void);
extern void pevStateMachineISO1_Start(void);

#ifdef __cplusplus
}
#endif
190 changes: 99 additions & 91 deletions ccs/pevStateMachineISO2.cpp

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions doc/development_hints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@


# Size comparisions depending on the used schema

Precondition: Use common exi document (in the makefile, set the compiler option -DUSE_SAME_DOC_FOR_ENCODER_AND_DECODER).

Limits: The STM32F103RE has 512k flash and 64k RAM.

## DIN only

* text data bss(RAM)
* 138568 2888 31692

## DIN and ISO1 (ISO 2013)

(This is the combination which KIA EV6 uses, according to a log file which was recorded with pyPLC.)
In the makefile, set the compiler option -DUSE_ISO1
* 242028 2888 54892

## DIN and ISO2 (ISO 2016)

In the makefile, set the compiler option -DUSE_ISO2
* 740352 2888 54628

Loading

0 comments on commit b3b9da2

Please sign in to comment.