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

Failed to generate json and keymap #30

Closed
khlkh opened this issue Aug 18, 2013 · 4 comments
Closed

Failed to generate json and keymap #30

khlkh opened this issue Aug 18, 2013 · 4 comments

Comments

@khlkh
Copy link

khlkh commented Aug 18, 2013

Build from master branch and encounter error in last step.

------- done --------------------------------------------------

avr-size --target=ihex firmware.hex
text data bss dec hex filename
0 9582 0 9582 256e firmware.hex

avr-size --target=ihex firmware.eep
text data bss dec hex filename
0 0 0 0 0 firmware.eep

you can load "firmware.hex" and "firmware.eep" onto the
Teensy using the Teensy loader


make[1]: Leaving directory `/home/khl/Downloads/ErgoDox/new/ergodox-firmware/src'
cp 'src/firmware.hex' 'build/ergodox-firmware--master--20130818T220607--8e7ab89--colemak-symbol-mod/firmware.hex'
cp 'src/firmware.eep' 'build/ergodox-firmware--master--20130818T220607--8e7ab89--colemak-symbol-mod/firmware.eep'
cp 'src/firmware.map' 'build/ergodox-firmware--master--20130818T220607--8e7ab89--colemak-symbol-mod/firmware.map'
( ./'build-scripts/gen-ui-info.py'
--current-date '2013-08-18 22:41:07+08:00'
--git-commit-date '2013-08-18 22:06:07 +0800'
--git-commit-id '8e7ab89466ffa958d0e46ae37ef3582d37744ea0'
--map-file-path 'build/ergodox-firmware--master--20130818T220607--8e7ab89--colemak-symbol-mod/firmware.map'
--source-code-path 'src'
--matrix-file-path 'src/keyboard/ergodox/matrix.h'
--layout-file-path
'src/keyboard/ergodox/layout/colemak-symbol-mod.c'
) > 'build/ergodox-firmware--master--20130818T220607--8e7ab89--colemak-symbol-mod/firmware--ui-info.json'
Traceback (most recent call last):
File "./build-scripts/gen-ui-info.py", line 475, in
main()
File "./build-scripts/gen-ui-info.py", line 467, in main
args.layout_file_path ))
File "./build-scripts/gen-ui-info.py", line 396, in gen_mappings
parse_layout_file(layout_file_path) )
File "./build-scripts/gen-ui-info.py", line 375, in parse_layout_file
[[eval(el) for el in layer] for layer in layout['_kb_layout']]
KeyError: '_kb_layout'
make: *** [build/ergodox-firmware--master--20130818T220607--8e7ab89--colemak-symbol-mod/firmware--ui-info.json] Error 1

@benblazak
Copy link
Owner

Please see the readme and maybe issue #19

@khlkh
Copy link
Author

khlkh commented Aug 19, 2013

Finally, got it work on my machine.

*** ergodox-firmware/build-scripts/gen-ui-info.py 2013-08-19 22:00:14.320530087 +0800
--- new/ergodox-firmware/build-scripts/gen-ui-info.py 2013-08-19 21:57:45.307586030 +0800


*** 168,183 ****
length = int( search.group(2), 16 )

    search = re.search(r'0x\S+\s+(\S+)', next(f))

! name = search.group(1)

! return {
! 'keyboard-functions': {
! name: {
! 'position': position,
! 'length': length,
},
! },
! }

def parse_layout_matrices(f, line):
    """Parse layout matrix information in the '.map' file"""

--- 168,184 ----
length = int( search.group(2), 16 )

    search = re.search(r'0x\S+\s+(\S+)', next(f))

! if search:
! name = search.group(1)

! return {
! 'keyboard-functions': {
! name: {
! 'position': position,
! 'length': length,
! },
},
! }

def parse_layout_matrices(f, line):
    """Parse layout matrix information in the '.map' file"""

*** 352,358 ****
def parse_layout_file(layout_file_path):
match = re.findall( # find each whole 'kb_layout' matrix definition
r'(kb_layout\w)[^=]=((?:[^{}]{){3}[^=](?:[^{}]}){3})',
! subprocess.getoutput("gcc -E '"+layout_file_path+"'") )

    layout = {}
    # collect all the values

--- 353,359 ----
def parse_layout_file(layout_file_path):
match = re.findall( # find each whole 'kb_layout' matrix definition
r'(kb_layout\w)[^=]=((?:[^{}]{){3}[^=](?:[^{}]}){3})',
! subprocess.getoutput("avr-gcc -D KEYBOARD__ERGODOX__LAYOUT_h -E '"+layout_file_path+"'") )

    layout = {}
    # collect all the values

@khlkh
Copy link
Author

khlkh commented Aug 19, 2013

Hi Ben Blazak

Thanks for the pointer. With some changes, the layout is generated.
diff -c ergodox-firmware/build-scripts/gen-ui-info.py new/ergodox-firmware/build-scripts/gen-ui-info.py
*** ergodox-firmware/build-scripts/gen-ui-info.py    2013-08-19 22:00:14.320530087 +0800
--- new/ergodox-firmware/build-scripts/gen-ui-info.py    2013-08-19 21:57:45.307586030 +0800


*** 168,183 ****
          length = int( search.group(2), 16 )
 
          search = re.search(r'0x\S+\s+(\S+)', next(f))
!         name = search.group(1)
 
!         return {
!             'keyboard-functions': {
!                 name: {
!                     'position': position,
!                     'length': length,
                  },
!             },
!         }
 
      def parse_layout_matrices(f, line):
          """Parse layout matrix information in the '.map' file"""
--- 168,184 ----
          length = int( search.group(2), 16 )
 
          search = re.search(r'0x\S+\s+(\S+)', next(f))
!         if search:
!             name = search.group(1)
 
!             return {
!                 'keyboard-functions': {
!                     name: {
!                         'position': position,
!                         'length': length,
!                     },
                  },
!             }
 
      def parse_layout_matrices(f, line):
          """Parse layout matrix information in the '.map' file"""


*** 352,358 ****
      def parse_layout_file(layout_file_path):
          match = re.findall(  # find each whole 'kb_layout' matrix definition
                  r'(kb_layout\w)[^=]=((?:[^{}]{){3}[^=](?:[^{}]}){3})',
!                 subprocess.getoutput("gcc -E '"+layout_file_path+"'") )
 
          layout = {}
          # collect all the values
--- 353,359 ----
      def parse_layout_file(layout_file_path):
          match = re.findall(  # find each whole 'kb_layout' matrix definition
                  r'(kb_layout\w)[^=]=((?:[^{}]{){3}[^=](?:[^{}]}){3})',
!                 subprocess.getoutput("avr-gcc -D KEYBOARD__ERGODOX__LAYOUT_h -E '"+layout_file_path+"'") )
 
          layout = {}
          # collect all the values


$ avr-gcc -v
Using built-in specs.
COLLECT_GCC=avr-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/4.7.2/lto-wrapper
Target: avr
Configured with: ../src/configure -v --enable-languages=c,c++ --prefix=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-libssp --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=avr
Thread model: single
gcc version 4.7.2 (GCC)

/khl


From: Ben Blazak notifications@github.com
To: benblazak/ergodox-firmware ergodox-firmware@noreply.github.com
Cc: khlkh khlkh@yahoo.com
Sent: Monday, August 19, 2013 5:28 AM
Subject: Re: [ergodox-firmware] Failed to generate json and keymap (#30)

Please see the readme and maybe issue #19

Reply to this email directly or view it on GitHub.

@benblazak
Copy link
Owner

Glad you got it working :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants