Skip to content

Commit

Permalink
Merge pull request #54 from donovan6000/devel
Browse files Browse the repository at this point in the history
Version 00.00.01.24 release
  • Loading branch information
donovan6000 authored Jun 6, 2017
2 parents 44e2f34 + 8dd13a0 commit cd68b65
Show file tree
Hide file tree
Showing 24 changed files with 474 additions and 91 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Changelog:

V00.00.01.24 June 6, 2017

* Update EEPROM addresses
* Fixed host commands that generate CRC32 checksums for the bootloader, application, and application table
* Fixed issue with M33 Manager flashing ROMs that have an uneven number of bytes

V00.00.01.23 October 20, 2016

* Fixed rounding issue that could cause floating point number to be formatted incorrectly
Expand Down
47 changes: 12 additions & 35 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Firmware name and version
FIRMWARE_NAME = iMe
FIRMWARE_VERSION = 00.00.01.23
ROM_VERSION_STRING = 1900000123
NAME = "iMe"
FIRMWARE_VERSION = 00.00.01.24
ROM_VERSION_STRING = 1900000124

FIRMWARE_NAME = $(subst $\",,$(NAME))

# Tool locations
ifeq ($(OS), Windows_NT)
Expand Down Expand Up @@ -94,53 +96,28 @@ INCPATH = . \
src/config

# Compiler flags
FLAGS = -D BOARD=USER_BOARD -D FIRMWARE_NAME=$(FIRMWARE_NAME) -D FIRMWARE_VERSION=$(FIRMWARE_VERSION) -Os -mmcu=atxmega32c4 -Wall -Wno-maybe-uninitialized -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -fno-strict-aliasing -Werror-implicit-function-declaration -Wpointer-arith -mcall-prologues -mstrict-X -maccumulate-args -fno-tree-ter -mrelax -flto -flto-partition=1to1
FLAGS = -D BOARD=USER_BOARD -D FIRMWARE_NAME="$(FIRMWARE_NAME)" -D FIRMWARE_VERSION=$(FIRMWARE_VERSION) -Os -mmcu=atxmega32c4 -Wall -Wno-maybe-uninitialized -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -fno-strict-aliasing -Werror-implicit-function-declaration -Wpointer-arith -mcall-prologues -mstrict-X -maccumulate-args -fno-tree-ter -mrelax -flto -flto-partition=1to1
ASFLAGS = -std=c++14 -x assembler-with-cpp
CFLAGS = -std=gnu99 -x c -Wstrict-prototypes -Wmissing-prototypes
CPPFLAGS = -std=c++14 -x c++
LFLAGS = -Wl,--section-start=.BOOT=0x8000 -Wl,--start-group -Wl,--end-group -Wl,--gc-sections
LFLAGS = -Wl,--start-group -Wl,--end-group -Wl,--gc-sections

# Make - Compiles firmware
all:
$(CC) $(foreach INC, $(addprefix , $(INCPATH)),-I $(INC)) $(FLAGS) $(ASFLAGS) -c $(ASSRCS)
$(CC) $(foreach INC, $(addprefix , $(INCPATH)),-I $(INC)) $(FLAGS) $(CFLAGS) -c $(CSRCS)
$(CC) $(foreach INC, $(addprefix , $(INCPATH)),-I $(INC)) $(FLAGS) $(CPPFLAGS) -c $(CPPSRCS)
$(CC) $(foreach INC, $(addprefix , $(INCPATH)),-I $(INC)) $(FLAGS) $(LFLAGS) *.o -o $(FIRMWARE_NAME).elf
@$(COPY) -O binary $(FIRMWARE_NAME).elf "$(FIRMWARE_NAME) $(ROM_VERSION_STRING).hex"
@$(SIZE) --mcu=atxmega32c4 -C $(FIRMWARE_NAME).elf
@rm -f *.o $(FIRMWARE_NAME).elf
$(CC) $(foreach INC, $(addprefix , $(INCPATH)),-I $(INC)) $(FLAGS) $(LFLAGS) *.o -o "$(FIRMWARE_NAME).elf"
@$(COPY) -O binary "$(FIRMWARE_NAME).elf" "$(FIRMWARE_NAME) $(ROM_VERSION_STRING).hex"
@$(SIZE) --mcu=atxmega32c4 -C "$(FIRMWARE_NAME).elf"
@rm -f *.o "$(FIRMWARE_NAME).elf"
@echo $(FIRMWARE_NAME) $(ROM_VERSION_STRING).hex is ready

# Make clean - Removes temporary files and compiled firmware
clean:
rm -f $(FIRMWARE_NAME).elf debug.elf "$(FIRMWARE_NAME) $(ROM_VERSION_STRING).hex" *.o
rm -f "$(FIRMWARE_NAME).elf" "$(FIRMWARE_NAME) $(ROM_VERSION_STRING).hex" *.o

# Make run - Flashes and runs compiled firmware
run:
@$(M33MANAGER) -r "$(FIRMWARE_NAME) $(ROM_VERSION_STRING).hex"
@$(M33MANAGER) -f

# Make production debug - Adds debug information to a production elf named production.elf
productionDebug:

@$(COPY) -O binary --only-section=.text production.elf text.bin
@$(COPY) -O binary --only-section=.eeprom production.elf eeprom.bin
@$(COPY) -O binary --only-section=.signature production.elf signature.bin
@$(COPY) -O binary --only-section=.lock production.elf lock.bin
@$(COPY) -O binary --only-section=.fuse production.elf fuse.bin
@$(COPY) -O binary --only-section=.user_signature production.elf user_signature.bin

@$(COPY) -B avr:102 --redefine-sym _binary_text_bin_start=main --rename-section .data=.text,contents,alloc,load,readonly,code -I binary -O elf32-avr text.bin text.o
@$(COPY) -B avr:102 --rename-section .data=.eeprom,contents,alloc,load,data -I binary -O elf32-avr eeprom.bin eeprom.o
@$(COPY) -B avr:102 --rename-section .data=.signature,contents,alloc,load,data -I binary -O elf32-avr signature.bin signature.o
@$(COPY) -B avr:102 --rename-section .data=.lock,contents,alloc,load,data -I binary -O elf32-avr lock.bin lock.o
@$(COPY) -B avr:102 --rename-section .data=.fuse,contents,alloc,load,data -I binary -O elf32-avr fuse.bin fuse.o
@$(COPY) -B avr:102 --rename-section .data=.user_signature,contents,alloc,load,data -I binary -O elf32-avr user_signature.bin user_signature.o

@touch stub.c

$(CC) -mmcu=atxmega32c4 -g3 -nostartfiles stub.c text.o eeprom.o signature.o lock.o fuse.o user_signature.o -Wl,--section-start,.text=0x00000000 -Wl,--section-start,.eeprom=0x00810000 -Wl,--section-start,.signature=0x00840000 -Wl,--section-start,.lock=0x00830000 -Wl,--section-start,.fuse=0x00820000 -Wl,--section-start,.user_signatures=0x00850000 -o debug.elf

$(DUMP) -h debug.elf
@rm -f *.o *.bin stub.c
@echo debug.elf is ready
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# iMe
© 2015-2016 Exploit Kings. All rights reserved.
© 2015-2017 Exploit Kings. All rights reserved.

### Description
iMe is firmware for the Micro 3D printer that attempts to fix the printer's biggest problem: limited software compatibility. iMe uses RepRap G-code protocol, so it allows you to use the Micro 3D printer with any 3D printing software that supports that protocol. It also features builtin backlash and bed compensation which makes creating good looking prints with other software possible since the G-code never has to be pre-processed beforehand.

The latest version of iMe is V00.00.01.23 released on October 20th, 2016, and an entire changelog for it can be found [here](https://raw.githubusercontent.com/donovan6000/iMe/master/Changelog).
The latest version of iMe is V00.00.01.24 released on June 6th, 2017, and an entire changelog for it can be found [here](https://raw.githubusercontent.com/donovan6000/iMe/master/Changelog).

### Features
* Uses RepRap's G-code protocol
Expand All @@ -16,7 +16,7 @@ The latest version of iMe is V00.00.01.23 released on October 20th, 2016, and an
* Allows configuring the steps/mm for each of the motors

### Installation
The easiest way to install iMe is with M33 Manager, which is available for [Windows](https://raw.githubusercontent.com/donovan6000/iMe/master/M33%20Manager/M33%20Manager%20Windows.zip), [macOS](https://raw.githubusercontent.com/donovan6000/iMe/master/M33%20Manager/M33%20Manager%20macOS.zip), and [Linux](https://raw.githubusercontent.com/donovan6000/iMe/master/M33%20Manager/M33%20Manager%20Linux.zip). Just connect the printer to M33 Manager and click the 'Install iMe firmware' button to install iMe.
The easiest way to install iMe is with M33 Manager, which is available for [Windows](https://raw.githubusercontent.com/donovan6000/iMe/master/M33%20Manager/M33%20Manager%20Windows.zip), [macOS](https://raw.githubusercontent.com/donovan6000/iMe/master/M33%20Manager/M33%20Manager%20macOS.dmg), and [Linux](https://raw.githubusercontent.com/donovan6000/iMe/master/M33%20Manager/M33%20Manager%20Linux.zip). Just connect the printer to M33 Manager and click the 'Install iMe firmware' button to install iMe.

iMe is also fully compatible with [M33 Fio](https://github.com/donovan6000/M33-Fio), and it can be installed from there as well.

Expand Down
2 changes: 1 addition & 1 deletion accelerometer.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Header gaurd
// Header guard
#ifndef ACCELEROMETER_H
#define ACCELEROMETER_H

Expand Down
15 changes: 15 additions & 0 deletions common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ extern "C" {
#include <asf.h>
}
#include <ctype.h>
#include <float.h>
#include <string.h>
#include "common.h"

Expand Down Expand Up @@ -218,3 +219,17 @@ uint32_t minimumOneCeil(float value) {
// Return ceiling of value that is at least one
return getValueInRange(ceil(value), 1, UINT32_MAX);
}

void leadingPadBuffer(char *buffer, uint8_t size, char padding) {

// Check if buffer is smaller that the specified size
uint8_t bufferSize = strlen(buffer);
if(bufferSize < size) {

// Shift buffer toward the end
memmove(&buffer[size - bufferSize], buffer, bufferSize + 1);

// Prepend padding to buffer
memset(buffer, padding, size - bufferSize);
}
}
8 changes: 7 additions & 1 deletion common.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Header gaurd
// Header guard
#ifndef COMMON_H
#define COMMON_H

Expand Down Expand Up @@ -87,5 +87,11 @@ Purpose: Returns the ceiling of the value that is at least one
*/
uint32_t minimumOneCeil(float value);

/*
Name: Leading pad buffer
Purpose: Adds leading padding to buffer to make it meet the size specified
*/
void leadingPadBuffer(char *buffer, uint8_t size = 2, char padding = '0');


#endif
29 changes: 23 additions & 6 deletions eeprom.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Header gaurd
// Header guard
#ifndef EEPROM_H
#define EEPROM_H

Expand All @@ -10,7 +10,7 @@
// Definitions

// EEPROM types
enum EEPROM_TYPES {EEPROM_INT, EEPROM_FLOAT, EEPROM_STRING};
enum EEPROM_TYPES {EEPROM_INT, EEPROM_FLOAT, EEPROM_STRING, EEPROM_BOOL};

// EEPROM offsets and lengths
#define EEPROM_FIRMWARE_VERSION_OFFSET 0x00
Expand Down Expand Up @@ -77,8 +77,16 @@ enum EEPROM_TYPES {EEPROM_INT, EEPROM_FLOAT, EEPROM_STRING};
#define EEPROM_SPEED_LIMIT_E_POSITIVE_LENGTH 4
#define EEPROM_SPEED_LIMIT_E_NEGATIVE_OFFSET 0x76
#define EEPROM_SPEED_LIMIT_E_NEGATIVE_LENGTH 4
#define EEPROM_FILAMENT_SIZE_OFFSET 0x82
#define EEPROM_FILAMENT_SIZE_LENGTH 1
#define EEPROM_FILAMENT_UID_OFFSET 0x83
#define EEPROM_FILAMENT_UID_LENGTH 4
#define EEPROM_BED_ORIENTATION_FIRST_SAMPLE_OFFSET 0x106
#define EEPROM_BED_ORIENTATION_FIRST_SAMPLE_LENGTH 4
#define EEPROM_EXPAND_PRINTABLE_REGION_OFFSET 0x294
#define EEPROM_EXPAND_PRINTABLE_REGION_LENGTH 1
#define EEPROM_EXTERNAL_BED_HEIGHT_OFFSET 0x295
#define EEPROM_EXTERNAL_BED_HEIGHT_LENGTH 4
#define EEPROM_CALIBRATE_Z0_CORRECTION_OFFSET 0x299
#define EEPROM_CALIBRATE_Z0_CORRECTION_LENGTH 4
#define EEPROM_X_JERK_SENSITIVITY_OFFSET 0x29D
Expand Down Expand Up @@ -164,6 +172,8 @@ enum EEPROM_TYPES {EEPROM_INT, EEPROM_FLOAT, EEPROM_STRING};
#define EEPROM_X_JERK_SENSITIVITY_TYPE EEPROM_INT
#define EEPROM_Y_JERK_SENSITIVITY_TYPE EEPROM_INT
#define EEPROM_CALIBRATE_Z0_CORRECTION_TYPE EEPROM_FLOAT
#define EEPROM_EXPAND_PRINTABLE_REGION_TYPE EEPROM_BOOL
#define EEPROM_EXTERNAL_BED_HEIGHT_TYPE EEPROM_FLOAT

// EEPROM default values
#define EEPROM_BACKLASH_X_DEFAULT 0.3
Expand All @@ -178,29 +188,32 @@ enum EEPROM_TYPES {EEPROM_INT, EEPROM_FLOAT, EEPROM_STRING};
#define EEPROM_BED_OFFSET_FRONT_RIGHT_DEFAULT 0.0
#define EEPROM_BED_OFFSET_FRONT_LEFT_DEFAULT 0.0
#define EEPROM_BED_HEIGHT_OFFSET_DEFAULT 0.0
#define EEPROM_FILAMENT_TEMPERATURE_DEFAULT (215 - 100)
#define EEPROM_SPEED_LIMIT_X_DEFAULT 1500.0
#define EEPROM_SPEED_LIMIT_Y_DEFAULT 1500.0
#define EEPROM_SPEED_LIMIT_Z_DEFAULT 60.0
#define EEPROM_SPEED_LIMIT_E_POSITIVE_DEFAULT 102.0
#define EEPROM_SPEED_LIMIT_E_NEGATIVE_DEFAULT 360.0
#define EEPROM_LAST_RECORDED_X_VALUE_DEFAULT 0.0
#define EEPROM_LAST_RECORDED_Y_VALUE_DEFAULT 0.0
#define EEPROM_LAST_RECORDED_Z_VALUE_DEFAULT 0.0
#define EEPROM_LAST_RECORDED_X_VALUE_DEFAULT 54.0
#define EEPROM_LAST_RECORDED_Y_VALUE_DEFAULT 50.0
#define EEPROM_LAST_RECORDED_Z_VALUE_DEFAULT 5.0
#define EEPROM_X_MOTOR_STEPS_PER_MM_DEFAULT 19.3067875
#define EEPROM_Y_MOTOR_STEPS_PER_MM_DEFAULT 18.00885
#define EEPROM_Z_MOTOR_STEPS_PER_MM_DEFAULT 646.3295
#define EEPROM_E_MOTOR_STEPS_PER_MM_DEFAULT 128.451375
#define EEPROM_X_JERK_SENSITIVITY_DEFAULT 195
#define EEPROM_Y_JERK_SENSITIVITY_DEFAULT 195
#define EEPROM_CALIBRATE_Z0_CORRECTION_DEFAULT 0.0
#define EEPROM_EXPAND_PRINTABLE_REGION_DEFAULT false
#define EEPROM_EXTERNAL_BED_HEIGHT_DEFAULT 0.0

// EEPROM min and max values
#define EEPROM_BACKLASH_X_MIN 0.0
#define EEPROM_BACKLASH_X_MAX 2.0
#define EEPROM_BACKLASH_Y_MIN 0.0
#define EEPROM_BACKLASH_Y_MAX 2.0
#define EEPROM_BACKLASH_SPEED_MIN 1.0
#define EEPROM_BACKLASH_SPEED_MAX 5000.0
#define EEPROM_BACKLASH_SPEED_MAX FLT_MAX
#define EEPROM_BED_ORIENTATION_BACK_RIGHT_MIN -3.0
#define EEPROM_BED_ORIENTATION_BACK_RIGHT_MAX 3.0
#define EEPROM_BED_ORIENTATION_BACK_LEFT_MIN -3.0
Expand All @@ -219,6 +232,8 @@ enum EEPROM_TYPES {EEPROM_INT, EEPROM_FLOAT, EEPROM_STRING};
#define EEPROM_BED_OFFSET_FRONT_RIGHT_MAX FLT_MAX
#define EEPROM_BED_HEIGHT_OFFSET_MIN -FLT_MAX
#define EEPROM_BED_HEIGHT_OFFSET_MAX FLT_MAX
#define EEPROM_FILAMENT_TEMPERATURE_MIN (150 - 100)
#define EEPROM_FILAMENT_TEMPERATURE_MAX (315 - 100)
#define EEPROM_SPEED_LIMIT_X_MIN 120.0
#define EEPROM_SPEED_LIMIT_X_MAX 4800.0
#define EEPROM_SPEED_LIMIT_Y_MIN 120.0
Expand Down Expand Up @@ -249,6 +264,8 @@ enum EEPROM_TYPES {EEPROM_INT, EEPROM_FLOAT, EEPROM_STRING};
#define EEPROM_Y_JERK_SENSITIVITY_MAX 255
#define EEPROM_CALIBRATE_Z0_CORRECTION_MIN -FLT_MAX
#define EEPROM_CALIBRATE_Z0_CORRECTION_MAX FLT_MAX
#define EEPROM_EXTERNAL_BED_HEIGHT_MIN 0
#define EEPROM_EXTERNAL_BED_HEIGHT_MAX 50.0


#endif
2 changes: 1 addition & 1 deletion fan.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Header gaurd
// Header guard
#ifndef FAN_H
#define FAN_H

Expand Down
2 changes: 1 addition & 1 deletion gcode.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Header gaurd
// Header guard
#ifndef GCODE_H
#define GCODE_H

Expand Down
2 changes: 1 addition & 1 deletion heater.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Header gaurd
// Header guard
#ifndef HEATER_H
#define HEATER_H

Expand Down
Binary file renamed iMe 1900000123.hex → iMe 1900000124.hex
Binary file not shown.
2 changes: 1 addition & 1 deletion led.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Header gaurd
// Header guard
#ifndef LED_H
#define LED_H

Expand Down
Loading

0 comments on commit cd68b65

Please sign in to comment.