Skip to content

Commit

Permalink
Use proper Arduino MAC Adress
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Nov 10, 2017
1 parent f506079 commit 9378e46
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
</option>
<option id="gnu.c.compiler.option.preprocessor.def.symbols.1830469217" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="STM32L072xx"/>
<listOptionValue builtIn="false" value=" USE_B_L072Z_LRWAN1"/>
<listOptionValue builtIn="false" value=" USE_FULL_LL_DRIVER"/>
<listOptionValue builtIn="false" value=" REGION_EU868"/>
<listOptionValue builtIn="false" value="USE_B_L072Z_LRWAN1"/>
<listOptionValue builtIn="false" value="USE_FULL_LL_DRIVER"/>
<listOptionValue builtIn="false" value="REGION_EU868"/>
<listOptionValue builtIn="false" value="REGION_AS923"/>
<listOptionValue builtIn="false" value="REGION_AU915"/>
<listOptionValue builtIn="false" value="REGION_CN470"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="636543255211264509" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="848516111187429693" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +0,0 @@
# This is an B-L072Z-LRWAN1 board with a single STM32L072CZYx chip
#
# Generated by System Workbench for STM32
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)

source [find interface/stlink.cfg]

set WORKAREASIZE 0x5000

transport select "hla_swd"

set CHIPNAME STM32L072CZYx

# Enable debug when in low power modes
set ENABLE_LOW_POWER 1

# Stop Watchdog counters when halt
set STOP_WATCHDOG 1

# STlink Debug clock frequency
set CLOCK_FREQ 4000

# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1

source [find target/stm32l0x.cfg]
15 changes: 9 additions & 6 deletions Projects/Multi/Applications/LoRa/AT_Slave/src/mlm32l0xx_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,19 +352,22 @@ uint32_t HW_GetRandomSeed(void)

void HW_GetUniqueId(uint8_t *id)
{
// First 3 bytes are Arduino OUI A8-61-0A
// Other 5 bytes are derived by STM32 internal ID registers

uint32_t id1 = *((uint32_t *)ID1);
uint32_t id2 = *((uint32_t *)ID2);
uint32_t id3 = *((uint32_t *)ID3);
uint32_t id13 = id1 + id3;

id[7] = id13 >> 24;
id[6] = id13 >> 16;
id[5] = id13 >> 8;
id[4] = id13;
id[3] = id2 >> 24;
id[2] = id2 >> 16;
id[1] = id2 >> 8;
id[0] = id2;
id[5] = id3 & 0xFF;
id[4] = id2 & 0xFF;
id[3] = id1 & 0xFF;
id[2] = 0x0A;
id[1] = 0x61;
id[0] = 0xA8;
}

uint8_t HW_GetBatteryLevel(void)
Expand Down

0 comments on commit 9378e46

Please sign in to comment.