2018年5月28日 星期一

CC2640: Merge app and stack hex file

1. Install Python2.7
2. Open cmd.exe type > pip install intelhex
 






3. Use below instruction to merge your hex file
python C:\Python27\Scripts\hexmerge.py -o .\SOMETHING_MERGED.hex -r 0000:1FFFF .\SOMETHING_APP.hex:0000:1FFFF .\SOMETHING_STACK.hex --overlap=error
view raw gistfile1.txt hosted with ❤ by GitHub

2018年5月13日 星期日

GO: Development a simple windows GUI use lxn-walk package(2) -- Combobox and Button

1.Create the project folder and win_gui_v1.go in your go work space
   > cd ..\src\
   > mkdir win_gui_v1
2.Copy the .manifest file and modify to your_execution.exe.manifest
 












3.Code
// Copyright 2017 The Walk Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"log"
"os"
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
)
func main() {
var connPB, exitPB *walk.PushButton
var comCB *walk.ComboBox
data := make([]string, 3)
data = []string{"123", "456", "789"}
if _, err := (MainWindow{
Title: "ComboBox Button",
Layout: VBox{},
Children: []Widget{
HSplitter{
Children: []Widget{
Label{
Text: "ComboBox:",
},
ComboBox{
AssignTo: &comCB,
Editable: false,
Model: data,
},
PushButton{
AssignTo: &connPB,
Text: "Show",
OnClicked: func() {
fmt.Println("Show " + data[comCB.CurrentIndex()])
},
},
},
},
PushButton{
AssignTo: &exitPB,
Text: "Exit",
OnClicked: func() {
fmt.Println("Exit")
os.Exit(0)
},
},
},
}).Run(); err != nil {
log.Fatal(err)
}
}
view raw gistfile1.txt hosted with ❤ by GitHub
3.Result
 











Ref:
      1. Go实战--使用golang开发Windows Gui桌面程序(lxn/walk)
      2. ComboBox 類別
      3. lxn/walk/examples

2018年5月6日 星期日

GO: Development a simple windows GUI use lxn-walk package(1) -- Getting start


"Walk is a "Windows Application Library Kit" for the Go Programming Language.
Its primarily useful for Desktop GUI development".  In this series I try to build a simple terminal program to commnunicate via COM port.

1. Getting start
    >   go get github.com/lxn/walk

2. Build the example
     >   cd ..\src\github.com\lxn\walk\examples\imageviewer
     >   go build

3. run the imageviewer.exe

  
    






Ref:
    1.  l/walk

GO : List all the serial port in windows use golang-sys package

We can easily get all the serial port in windows using regedit.exe











In our application we read the windows register key `HARDWARE\\DEVICEMAP\\SERIALCOMM` through windows API and list all the sub key and value.


Github project: win_serial_console

Linux driver: How to enable dynamic debug at booting time for built-in driver.

 Dynamic debug is useful for debug driver, and can be enable by: 1. Mount debug fs #>mount -t debugfs none /sys/kernel/debug 2. Enable dy...