Git Product home page Git Product logo

stbridge's Introduction

Hello there! ✨

I primarily work on projects in the embedded hardware/software and digital design space. Outside of $DAYJOB, virtually everything I do is here and open-source.

Here's the repos where I store personal projects. Not organized for collaboration, but rather meant as a starting point for anyone wanting to do something similar.

These projects were intended for direct use by others. Open to collaboration!

The following are earlier work that's now archived and won't be maintained.

stbridge's People

Contributors

dragonlock2 avatar pdietl avatar snoonan-wp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

stbridge's Issues

Question: How much effort would this be to port to Windows?

Having linux/macos support is great, but my use case is partly to service existing manufacturing environments that are using Windows.

I noticed that the bridge wrapper recompiles the ST official usb driver from source, however on windows they do release STLinkUSBDriver.dll (in STSW-LINK007) as the low level library. It seems like it should work ok with the ST bridge cpp/h and your bridge wrapper based on boost:python.

Do you have any plans to port to windows? If not, do you foresee any major difficulties with porting it across to windows?

BRG_ERROR: 1 BRG_CONNECT_ERR, ///< USB Connection error

prodigytrip@prodigytrip-IdeaPad-Gaming-3-15ARH05:~/stbridge$ python3 tests/all.py
Traceback (most recent call last):
File "/home/prodigytrip/stbridge/tests/all.py", line 5, in
dev = st.USBInterface.list_devices()[0]
RuntimeError: BRG_ERROR: 1

stbridge.so STLink_GetNbDevices20TEnumStlinkInterface undefined symbol issue

hi ,
i try to build and it should be success. but when import "stbridge.so" it error (not found symbol)
it seem py2.7 /python3 issue ? how ot solve?

parallels@parallels-Parallels-Virtual-Platform:~/Downloads/test_stpy$ env PYTHONPATH='/home/parallels/Downloads/test_stpy/lib' python
Python 2.7.17 (default, Sep 30 2020, 13:38:04)
[GCC 7.5.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import sys,os
sys.path.append(os.getcwd())
import stbridge as st
Traceback (most recent call last):
File "", line 1, in
ImportError: /home/parallels/Downloads/test_stpy/lib/stbridge.so: undefined symbol: _Z19STLink_GetNbDevices20TEnumStlinkInterface

boost_python(it is py27)

util.find_library("boost_python")
'libboost_python-py27.so.1.65.1'


setup.py

ext = Extension(
'stbridge',
sources=['stbridge.cpp', 'bridge/bridge.cpp', 'common/criticalsectionlock.cpp',
'common/stlink_device.cpp', 'common/stlink_interface.cpp', 'error/ErrLog.cpp'],
libraries=['boost_python-py27'],
extra_compile_args=['-std=c++17', '-Ibridge', '-Icommon', '-Ilibs/src/error'],
extra_link_args=['-L.', '-lusb-1.0', '-lfmt','-Llib/libSTLinkUSBDriver.so']
)

build log(it show python3??)

python3 setup.py build_ext --inplace
running build_ext
building 'stbridge' extension
creating build
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/bridge
creating build/temp.linux-x86_64-3.6/common
creating build/temp.linux-x86_64-3.6/error
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c stbridge.cpp -o build/temp.linux-x86_64-3.6/stbridge.o -std=c++17 -Ibridge -Icommon -Ilibs/src/error
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c bridge/bridge.cpp -o build/temp.linux-x86_64-3.6/bridge/bridge.o -std=c++17 -Ibridge -Icommon -Ilibs/src/error
bridge/bridge.cpp: In member function ‘Brg_StatusT Brg::CalculateI2cTimingReg(I2cModeT, int, double, int, int, int, bool, uint32_t*)’:
bridge/bridge.cpp:969:12: warning: variable ‘targetPeriodI2C’ set but not used [-Wunused-but-set-variable]
double targetPeriodI2C; // Target period of clock
^~~~~~~~~~~~~~~
bridge/bridge.cpp:1105:6: warning: variable ‘l’ set but not used [-Wunused-but-set-variable]
int l = 0;
^
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c common/criticalsectionlock.cpp -o build/temp.linux-x86_64-3.6/common/criticalsectionlock.o -std=c++17 -Ibridge -Icommon -Ilibs/src/error
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c common/stlink_device.cpp -o build/temp.linux-x86_64-3.6/common/stlink_device.o -std=c++17 -Ibridge -Icommon -Ilibs/src/error
In file included from common/stlink_device.cpp:25:0:
common/stlink_device.h: In constructor ‘StlinkDevice::StlinkDevice(STLinkInterface&)’:
common/stlink_device.h:109:7: warning: ‘StlinkDevice::m_bOpenExclusive’ will be initialized after [-Wreorder]
bool m_bOpenExclusive;
^~~~~~~~~~~~~~~~
common/stlink_device.h:106:20: warning: ‘STLinkInterface* StlinkDevice::m_pStlinkInterface’ [-Wreorder]
STLinkInterface * m_pStlinkInterface;
^~~~~~~~~~~~~~~~~~
common/stlink_device.cpp:42:1: warning: when initialized here [-Wreorder]
StlinkDevice::StlinkDevice(STLinkInterface &StlinkIf): m_bStlinkConnected(false),m_bOpenExclusive(false),
^~~~~~~~~~~~
common/stlink_device.cpp: In member function ‘STLinkIf_StatusT StlinkDevice::PrivOpenStlink(const char*, bool)’:
common/stlink_device.cpp:164:9: warning: unused variable ‘pEnumUniqueId’ [-Wunused-variable]
char * pEnumUniqueId = devInfo2.EnumUniqueId;
^~~~~~~~~~~~~
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c common/stlink_interface.cpp -o build/temp.linux-x86_64-3.6/common/stlink_interface.o -std=c++17 -Ibridge -Icommon -Ilibs/src/error
common/stlink_interface.cpp: In member function ‘STLinkIf_StatusT STLinkInterface::EnumDevicesIfRequired(uint32_t*, bool, bool)’:
common/stlink_interface.cpp:319:11: warning: unused variable ‘status’ [-Wunused-variable]
uint32_t status = SS_OK;
^~~~~~
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.6m -c error/ErrLog.cpp -o build/temp.linux-x86_64-3.6/error/ErrLog.o -std=c++17 -Ibridge -Icommon -Ilibs/src/error
x86_64-linux-gnu-g++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/stbridge.o build/temp.linux-x86_64-3.6/bridge/bridge.o build/temp.linux-x86_64-3.6/common/criticalsectionlock.o build/temp.linux-x86_64-3.6/common/stlink_device.o build/temp.linux-x86_64-3.6/common/stlink_interface.o build/temp.linux-x86_64-3.6/error/ErrLog.o -lboost_python-py27 -o /home/parallels/Downloads/test_stpy/stbridge.cpython-36m-x86_64-linux-gnu.so -L. -lusb-1.0 -lfmt -Llib/libSTLinkUSBDriver.so

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.