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

MCU code for Rev 2 CM #114

Merged
merged 35 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9ec4295
Rev 2 CM Updates
pwittich Sep 1, 2021
f7a9629
Rev1 all K_-> F1_, V_->F2_
pwittich Sep 1, 2021
b45c6ba
MCU ADC updates for Rev2
pwittich Sep 1, 2021
353b697
adc updates
pwittich Sep 2, 2021
0fd0fcc
I hate vs code
pwittich Sep 2, 2021
225826e
minor cleanup
pwittich Sep 2, 2021
3616ee2
pinmux and pinout
pwittich Sep 4, 2021
dedce0f
pinout makefile
pwittich Sep 4, 2021
4818271
I2C information for LGA80D in Rev2
pwittich Sep 7, 2021
2874fe2
Put in correct output settings
pwittich Sep 8, 2021
0196376
many rev2 changes
pwittich Sep 8, 2021
83ede85
more Rev2 prep
pwittich Sep 9, 2021
b7d4021
Update c-cpp.yml
pwittich Sep 9, 2021
eea1cad
Update codeql-analysis.yml
pwittich Sep 9, 2021
ebe0151
UART test
pwittich Sep 14, 2021
9c19937
updates for the boot loader for Rev2
pwittich Sep 14, 2021
c3ffc50
Rev 2 continues
pwittich Sep 15, 2021
87ceeac
revert incorrect change
pwittich Sep 16, 2021
557b873
pointer to print function and hard-coded supply count
pwittich Sep 16, 2021
9051f80
more edits for Rev2
pwittich Sep 16, 2021
e129fb1
fix Rev1 compile issue
pwittich Sep 16, 2021
e35482f
Update Makefile
pwittich Sep 20, 2021
aab9a82
Update c-cpp.yml
pwittich Sep 21, 2021
f183ad1
Add a way to read out arbitrary LGA80D register
pwittich Oct 8, 2021
101966a
Merge branch 'rev2_checkout' of github.com:apollo-lhc/cm_mcu into rev…
pwittich Oct 8, 2021
62f4eaf
missing file in header
pwittich Oct 8, 2021
73c5d84
Fix bug with i2crr
pwittich Oct 11, 2021
312f14a
Update bl_link.ld
pwittich Oct 11, 2021
fcb6e49
fix FF device addresses for Rev2
pwittich Oct 14, 2021
bf65309
Change from hardcoded value to NFIREFLIES for firefly status etc comm…
pwittich Oct 14, 2021
377f9c9
Merge branch 'rev2_checkout' of github.com:apollo-lhc/cm_mcu into rev…
pwittich Oct 14, 2021
8f54e12
Update masks for Rev2 VCCINT supplies now that both are working
pwittich Oct 14, 2021
daf7f5b
intermediate state before adding semaphore to firefly I2C access
pwittich Oct 19, 2021
40bbbfc
fix bug in LOL register in firefly task
pwittich Nov 2, 2021
e4ff711
Add firefly task suspend command
pwittich Nov 2, 2021
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
8 changes: 4 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ jobs:
- name: make with GCC, debug build
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make -k DEBUG=1
make -k DEBUG=1 REV1=1
- name: make with GCC
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make clean
make REV1=1 clean
arm-none-eabi-gcc --version
make -k
make -k REV1=1

build-clang:
# this build also needs arm-none-eabi-gcc as some of the clang sysroot stuff depends on it.
Expand Down Expand Up @@ -101,4 +101,4 @@ jobs:
- name: make with CLANG
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
make -k COMPILER=clang
make -k COMPILER=clang REV1=1
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: "CodeQL"

on:
push:
branches: [ master ]
branches: [ master rev2_checkout ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
run: |
export PATH=${PATH}:$HOME/work/_temp/arm-none-eabi/bin:
arm-none-eabi-gcc --version
make -k -w VERBOSE=1
make -k -w VERBOSE=1 REV1=1

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@

include ./makedefs

ifdef REV1
ifdef REV2
$(error "REV1 and REV2 are mutually exclusive")
endif
endif

ifndef REV1
ifndef REV2
$(error "Must define either REV1 or REV2")
endif
endif


DIRS=driverlib projects
DIRSCLEAN=$(addsuffix .clean,$(DIRS))
Expand Down
2 changes: 1 addition & 1 deletion cm_mcu.gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ end
# to investigate origin of fault
set $exc_frame = ($lr & 0x4) ? $psp : $msp
set $stacked_xpsr = ((uint32_t *)$exc_frame)[7]
set $exc_frame_len = 32 + ((($stacked_xpsr & (1 << 9)) ? 0x4 : 0x0) + (($lr & 0x10) ? 0 : 72)
set $exc_frame_len = 32 + ((($stacked_xpsr & (1 << 9)) ? 0x4 : 0x0) + (($lr & 0x10) ? 0 : 72))
set $sp=($exc_frame + $exc_frame_len)
set $lr=((uint32_t *)$exc_frame)[5]
set $pc=((uint32_t *)$exc_frame)[6]
Expand Down
File renamed without changes.
302 changes: 302 additions & 0 deletions common/TM4C129x_rev2.pinmux
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
/**
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
* @cliArgs --device "TM4C129x" --package "128 Pin QFP|32x32" --part "TM4C1290NCPDT"
* @versions {"tool":"1.9.0+2015"}
*/

/**
* These are the peripherals and settings in this configuration
*/
const iADC1 = scripting.addPeripheral("ADC");
iADC1.$name = "ADC1";
iADC1.$assign = "ADC1";
iADC1.AIN14.$assign = "ball.2";
iADC1.AIN0.$assign = "ball.12";
iADC1.AIN17.$assign = "ball.19";
iADC1.AIN4.$used = false;
iADC1.AIN6.$used = false;
iADC1.AIN15.$assign = "ball.1";
iADC1.AIN12.$assign = "ball.4";
iADC1.AIN2.$assign = "ball.14";
iADC1.AIN11.$used = false;
iADC1.AIN19.$assign = "ball.21";
iADC1.AIN16.$assign = "ball.18";
iADC1.AIN13.$assign = "ball.3";
iADC1.AIN9.$used = false;
iADC1.AIN8.$used = false;
iADC1.AIN1.$assign = "ball.13";
iADC1.AIN3.$assign = "ball.15";
iADC1.AIN18.$assign = "ball.20";
iADC1.AIN10.$used = false;
iADC1.AIN7.$used = false;
iADC1.AIN5.$used = false;
const iADC2 = scripting.addPeripheral("ADC");
iADC2.$name = "ADC0";
iADC2.AIN14.$used = false;
iADC2.AIN0.$used = false;
iADC2.AIN17.$used = false;
iADC2.AIN4.$assign = "ball.128";
iADC2.AIN6.$assign = "ball.126";
iADC2.AIN15.$used = false;
iADC2.AIN12.$used = false;
iADC2.AIN2.$used = false;
iADC2.AIN11.$assign = "ball.120";
iADC2.AIN19.$used = false;
iADC2.AIN16.$used = false;
iADC2.AIN13.$used = false;
iADC2.AIN9.$assign = "ball.123";
iADC2.AIN8.$assign = "ball.124";
iADC2.AIN1.$used = false;
iADC2.AIN3.$used = false;
iADC2.AIN18.$used = false;
iADC2.AIN10.$assign = "ball.121";
iADC2.AIN7.$assign = "ball.125";
iADC2.AIN5.$assign = "ball.127";
const iGPIO1 = scripting.addPeripheral("GPIO");
iGPIO1["0"].io = "outputOpenDrain";
iGPIO1["0"].$assign = "ball.5";
iGPIO1.$name = "_I2C_RESET_PWR";
const iGPIO2 = scripting.addPeripheral("GPIO");
iGPIO2["0"].io = "outputOpenDrain";
iGPIO2["0"].$assign = "ball.6";
iGPIO2.$name = "_I2C_RESET_CLOCKS";
const iGPIO3 = scripting.addPeripheral("GPIO");
iGPIO3["0"].io = "outputOpenDrain";
iGPIO3["0"].$assign = "ball.11";
iGPIO3.$name = "_I2C_RESET_F2_OPTICS";
const iGPIO4 = scripting.addPeripheral("GPIO");
iGPIO4["0"].$assign = "ball.22";
iGPIO4.$name = "PG_4V0";
const iGPIO5 = scripting.addPeripheral("GPIO");
iGPIO5["0"].io = "output";
iGPIO5["0"].$assign = "ball.23";
iGPIO5.$name = "F2_CFG_START";
const iGPIO6 = scripting.addPeripheral("GPIO");
iGPIO6["0"].io = "outputOpenDrain";
iGPIO6["0"].$assign = "ball.27";
iGPIO6.$name = "_I2C_RESET_F1_OPTICS";
const iGPIO7 = scripting.addPeripheral("GPIO");
iGPIO7["0"].io = "outputOpenDrain";
iGPIO7["0"].$assign = "ball.29";
iGPIO7.$name = "_I2C_RESET_FPGAS";
const iGPIO8 = scripting.addPeripheral("GPIO");
iGPIO8["0"].$assign = "ball.30";
iGPIO8.$name = "SM_SOFT_PWR_EN";
const iGPIO9 = scripting.addPeripheral("GPIO");
iGPIO9["0"].$assign = "ball.31";
iGPIO9.$name = "PG_3V3";
const iGPIO10 = scripting.addPeripheral("GPIO");
iGPIO10["0"].$assign = "ball.32";
iGPIO10.$name = "PG_1V8";
const iGPIO11 = scripting.addPeripheral("GPIO");
iGPIO11["0"].$assign = "ball.42";
iGPIO11.$name = "PG_F1_INT_A";
const iGPIO12 = scripting.addPeripheral("GPIO");
iGPIO12["0"].$assign = "ball.43";
iGPIO12.$name = "PG_F1_INT_B";
const iGPIO13 = scripting.addPeripheral("GPIO");
iGPIO13["0"].$assign = "ball.44";
iGPIO13.$name = "PG_F1_AVCC";
const iGPIO14 = scripting.addPeripheral("GPIO");
iGPIO14["0"].$assign = "ball.45";
iGPIO14.$name = "PG_F1_AVTT";
const iGPIO15 = scripting.addPeripheral("GPIO");
iGPIO15["0"].$assign = "ball.46";
iGPIO15.$name = "PG_F1_VCCAUX";
const iGPIO16 = scripting.addPeripheral("GPIO");
iGPIO16["0"].$assign = "ball.57";
iGPIO16.$name = "PG_F2_INT_A";
const iGPIO17 = scripting.addPeripheral("GPIO");
iGPIO17["0"].$assign = "ball.58";
iGPIO17.$name = "PG_F2_INT_B";
const iGPIO18 = scripting.addPeripheral("GPIO");
iGPIO18["0"].$assign = "ball.59";
iGPIO18.$name = "PG_F2_AVCC";
const iGPIO19 = scripting.addPeripheral("GPIO");
iGPIO19["0"].$assign = "ball.60";
iGPIO19.$name = "PG_F2_AVTT";
const iGPIO20 = scripting.addPeripheral("GPIO");
iGPIO20["0"].$assign = "ball.61";
iGPIO20.$name = "PG_F2_VCCAUX";
const iGPIO21 = scripting.addPeripheral("GPIO");
iGPIO21["0"].$assign = "ball.62";
iGPIO21.$name = "_F1_CFG_DONE";
const iGPIO22 = scripting.addPeripheral("GPIO");
iGPIO22["0"].$assign = "ball.71";
iGPIO22.$name = "_F2_CFG_DONE";
const iGPIO23 = scripting.addPeripheral("GPIO");
iGPIO23["0"].$assign = "ball.72";
iGPIO23.$name = "F1_TO_MCU";
const iGPIO24 = scripting.addPeripheral("GPIO");
iGPIO24["0"].$assign = "ball.73";
iGPIO24.$name = "F2_TO_MCU";
const iGPIO25 = scripting.addPeripheral("GPIO");
iGPIO25["0"].io = "output";
iGPIO25["0"].$assign = "ball.74";
iGPIO25.$name = "MCU_TO_F1";
const iGPIO26 = scripting.addPeripheral("GPIO");
iGPIO26["0"].$assign = "ball.75";
iGPIO26.$name = "MCU_TO_F2";
const iGPIO27 = scripting.addPeripheral("GPIO");
iGPIO27["0"].io = "output";
iGPIO27["0"].$assign = "ball.76";
iGPIO27.$name = "CM_TO_SM_PWR_OK";
const iGPIO28 = scripting.addPeripheral("GPIO");
iGPIO28["0"].io = "output";
iGPIO28["0"].$assign = "ball.77";
iGPIO28.$name = "EN_3V3";
const iGPIO29 = scripting.addPeripheral("GPIO");
iGPIO29["0"].io = "output";
iGPIO29["0"].$assign = "ball.78";
iGPIO29.$name = "EN_1V8";
const iGPIO30 = scripting.addPeripheral("GPIO");
iGPIO30["0"].io = "output";
iGPIO30["0"].$assign = "ball.81";
iGPIO30.$name = "EN_F1_INT";
const iGPIO31 = scripting.addPeripheral("GPIO");
iGPIO31["0"].io = "output";
iGPIO31["0"].$assign = "ball.82";
iGPIO31.$name = "EN_F1_AVCC";
const iGPIO32 = scripting.addPeripheral("GPIO");
iGPIO32["0"].io = "output";
iGPIO32["0"].$assign = "ball.83";
iGPIO32.$name = "EN_F1_AVTT";
const iGPIO33 = scripting.addPeripheral("GPIO");
iGPIO33["0"].io = "output";
iGPIO33["0"].$assign = "ball.84";
iGPIO33.$name = "EN_F1_VCCAUX";
const iGPIO34 = scripting.addPeripheral("GPIO");
iGPIO34["0"].io = "output";
iGPIO34["0"].$assign = "ball.85";
iGPIO34.$name = "EN_F2_INT";
const iGPIO35 = scripting.addPeripheral("GPIO");
iGPIO35["0"].io = "output";
iGPIO35["0"].$assign = "ball.86";
iGPIO35.$name = "EN_F2_AVCC";
const iGPIO36 = scripting.addPeripheral("GPIO");
iGPIO36["0"].io = "output";
iGPIO36["0"].$assign = "ball.93";
iGPIO36.$name = "EN_F2_AVTT";
const iGPIO37 = scripting.addPeripheral("GPIO");
iGPIO37["0"].io = "output";
iGPIO37["0"].$assign = "ball.94";
iGPIO37.$name = "EN_F2_VCCAUX";
const iGPIO38 = scripting.addPeripheral("GPIO");
iGPIO38["0"].io = "output";
iGPIO38["0"].$assign = "ball.102";
iGPIO38.$name = "FPGA_CFG_FROM_FLASH";
const iGPIO39 = scripting.addPeripheral("GPIO");
iGPIO39["0"].io = "output";
iGPIO39["0"].$assign = "ball.103";
iGPIO39.$name = "F1_CFG_START";
const iGPIO40 = scripting.addPeripheral("GPIO");
iGPIO40["0"].io = "output";
iGPIO40["0"].$assign = "ball.104";
iGPIO40.$name = "MCU_LED_RED";
const iGPIO41 = scripting.addPeripheral("GPIO");
iGPIO41["0"].io = "output";
iGPIO41["0"].$assign = "ball.105";
iGPIO41.$name = "MCU_LED_GREEN";
const iGPIO42 = scripting.addPeripheral("GPIO");
iGPIO42["0"].io = "output";
iGPIO42["0"].$assign = "ball.106";
iGPIO42.$name = "MCU_LED_BLUE";
const iGPIO43 = scripting.addPeripheral("GPIO");
iGPIO43["0"].io = "output";
iGPIO43["0"].$assign = "ball.107";
iGPIO43.$name = "ID_EEPROM_WP";
const iGPIO44 = scripting.addPeripheral("GPIO");
iGPIO44["0"].io = "output";
iGPIO44["0"].$assign = "ball.108";
iGPIO44.$name = "JTAG_FROM_SM";
const iGPIO45 = scripting.addPeripheral("GPIO");
iGPIO45["0"].io = "output";
iGPIO45["0"].$assign = "ball.109";
iGPIO45.$name = "_F1_JTAG_BYPASS";
const iGPIO46 = scripting.addPeripheral("GPIO");
iGPIO46["0"].io = "output";
iGPIO46["0"].$assign = "ball.110";
iGPIO46.$name = "_F2_JTAG_BYPASS ";
const iGPIO47 = scripting.addPeripheral("GPIO");
iGPIO47["0"].$assign = "ball.116";
iGPIO47.$name = "F1_C2C_OK";
const iGPIO48 = scripting.addPeripheral("GPIO");
iGPIO48["0"].$assign = "ball.117";
iGPIO48.$name = "F2_C2C_OK";
const iGPIO49 = scripting.addPeripheral("GPIO");
iGPIO49["0"].$assign = "ball.118";
iGPIO49.$name = "_F1_INSTALLED";
const iGPIO50 = scripting.addPeripheral("GPIO");
iGPIO50["0"].$assign = "ball.119";
iGPIO50.$name = "_F2_INSTALLED";
const iI2C1 = scripting.addPeripheral("I2C");
iI2C1.$name = "POWER_I2C";
iI2C1.$assign = "I2C1";
iI2C1.SCL.$assign = "ball.49";
iI2C1.SDA.$assign = "ball.50";
const iI2C2 = scripting.addPeripheral("I2C");
iI2C2.$name = "CLOCK_I2C";
iI2C2.$assign = "I2C2";
iI2C2.SCL.$assign = "ball.51";
iI2C2.SDA.$assign = "ball.52";
const iI2C3 = scripting.addPeripheral("I2C");
iI2C3.$name = "F2_OPTICS_I2C";
iI2C3.$assign = "I2C3";
iI2C3.SCL.$assign = "ball.53";
iI2C3.SDA.$assign = "ball.54";
const iI2C4 = scripting.addPeripheral("I2C");
iI2C4.$name = "F1_OPTICS_I2C";
iI2C4.$assign = "I2C4";
iI2C4.SCL.$assign = "ball.55";
iI2C4.SDA.$assign = "ball.56";
const iI2C5 = scripting.addPeripheral("I2C");
iI2C5.$name = "SM_I2C";
iI2C5.$assign = "I2C0";
iI2C5.SCL.$assign = "ball.91";
iI2C5.SDA.$assign = "ball.92";
const iI2C6 = scripting.addPeripheral("I2C");
iI2C6.$name = "FPGA_I2C";
iI2C6.$assign = "I2C5";
iI2C6.SCL.$assign = "ball.95";
iI2C6.SDA.$assign = "ball.96";
const iUART1 = scripting.addPeripheral("UART");
iUART1.$name = "ZYNQ_UART";
iUART1.$assign = "UART0";
iUART1.RX.$assign = "ball.33";
iUART1.TX.$assign = "ball.34";
iUART1.DCD.$used = false;
iUART1.DTR.$used = false;
iUART1.CTS.$used = false;
iUART1.DSR.$used = false;
iUART1.RTS.$used = false;
iUART1.RI.$used = false;
const iUART2 = scripting.addPeripheral("UART");
iUART2.$name = "IMPC_UART";
iUART2.$assign = "UART3";
iUART2.RX.$assign = "ball.37";
iUART2.TX.$assign = "ball.38";
iUART2.DCD.$used = false;
iUART2.DTR.$used = false;
iUART2.CTS.$used = false;
iUART2.DSR.$used = false;
iUART2.RTS.$used = false;
iUART2.RI.$used = false;
const iUART3 = scripting.addPeripheral("UART");
iUART3.$name = "MON_UART";
iUART3.$assign = "UART4";
iUART3.RX.$assign = "ball.35";
iUART3.TX.$assign = "ball.36";
iUART3.DCD.$used = false;
iUART3.DTR.$used = false;
iUART3.CTS.$used = false;
iUART3.DSR.$used = false;
iUART3.RTS.$used = false;
iUART3.RI.$used = false;

/**
* Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
* re-solve from scratch.
*/
iADC2.$suggestSolution = "ADC0";
Loading