Sentis-ToF-M100
Getting Started Programming
Version 1
Страница 1: ...Sentis ToF M100 Getting Started Programming Version 1 ...
Страница 2: ... 308 A Publication date July 18 2013 Subject to change without notice Errors excepted This document is protected by copyright All rights reserved No part of this document may be reproduced or transmitted for any purpose in any form or by any means electronically or mechanically without expressly written permission by Bluetechnix GmbH Windows is a registered trademark of Microsoft ...
Страница 3: ...AG device 9 3 4 1 Using the VDSP Flash Programmer 9 4 Sentis ToF M100 VDSP Project 11 4 1 Project Structure 11 4 1 1 Dependencies 11 4 1 2 Components and Data Flow 12 4 2 Features and Functions 12 4 2 1 Program Flow 12 4 2 2 Buffer Management 16 4 2 3 Register Access 18 4 3 Customizing streams 19 4 4 Start Here User Thread 19 4 5 Threading 21 4 6 Semaphore 23 4 7 Mutex 24 5 Recommended Documents 2...
Страница 4: ... or in any communication with you Bluetechnix specifically disclaims any implied warranty of merchantability or fitness for a particular purpose Bluetechnix takes no liability for any damages and errors causing of the usage of this board The user of this board is responsible by himself for the functionality of his application He is allowed to use the board only if he has the qualification More inf...
Страница 5: ...erty damage or damage to the device Caution Indicates a situation which if not avoided may result in minor damage to the device in malfunction of the device or in data loss Note Notes provide information on special issues related to the device or provide information that will make operation of the device easier Procedures A procedure always starts with a headline 1 The number indicates the step nu...
Страница 6: ...Analog Devices website Get your copy of VDSP at http www analog com Install both the program and the update For further information refer to the documentation contained in the VDSP download 2 2 Plugging the JTAG device In order to connect your computer with the Sentis over JTAG an adapter is needed Figure 1 JTAG adapter for Sentis ToF M100 Figure 2 Sentis ToF M100 with JTAG adapter ...
Страница 7: ...ter in the proper way shown in Figure 2 2 3 Creating a Session In order to open a debug session to the Sentis ToF M100 follow following steps 1 Connect the Sentis with power and JTAG 2 Connect the JTAG to your pc 3 In VDSP click on Session New Session The session wizard opens Figure 3 Figure 3 Session creation wizard 4 Select ADSP BF561 and click Next ...
Страница 8: ...izard 5 When asked for the connection type select Emulator Figure 4 and click Next Figure 5 Session creation wizard 6 The platform used depends on your JTAG device Please select the one you have purchased and click Finish Figure 5 the session wizard closes and the device is already connected 7 Now click on Settings Target Options ...
Страница 9: ... on Settings JTAG Frequency Selection and choose a higher frequency 10 Lastly click on Settings Session the session settings open up Figure 7 Session settings 11 Check the checkbox besides Enable customizations and select the file in your support package Sentis ToF M100_development_package prj BLT tof firmware sentis tof m100_bsp vdsp common sentis tof m100 custom xml Figure 7 12 After the require...
Страница 10: ...t is tailored for this product and should only be modified if necessary 3 3 Programming with JTAG Device If you have a JTAG device from Analog Devices you can just download the executable with the load command of VDSP Refer to the VDSP documentation for further information 3 4 Flashing applications with JTAG device Caution If you flash your application via VDSP and JTAG the Bootloader is overwritt...
Страница 11: ...lDriver_V1 0 0 dxe included in the support package Press the Load Driver button The section Flash information should be filled as shown in the figure below Figure 8 Device Programmer window when driver is loaded Select the Programming tab Make sure to only erase affected sectors that the file format is set to binary select the loader file to flash and press the Program button When done disconnect ...
Страница 12: ..._CoreA dlb Source code in project Sentis_tof_m100_bf561_firmware_CoreA Source code in project sentis_tof_m100_bf561_firmware_lwip_B Figure 9 Dependencies when compiling executables and the loader file Libraries are precompiled and have the file extension dlb Executables dxe files are for downloading and debugging via JTAG Loader files ldr files can be programmed onto flash memory either via JTAG o...
Страница 13: ... Queue Tcp Streaming Interface Ssdi Streaming Interface Tcp Control Interface I2 C Control Interface Serial Control Interface Register Map Udp Streaming Interface Core B Core A Control data Camera data Figure 10 Components and the flow of data between them 4 2 Features and Functions 4 2 1 Program Flow This section lists the relevant running threads and describes their tasks Core A does not run a k...
Страница 14: ...Start thread Udp streamer Start thread Ssdi streamer Finished Start thread User thread Register check thread start A relevant register changed N Y Notify corresponding thread component about change Core A main start Integration image capturing Data processing filtering Data enqueuing in queue Register map synchronization Initialization Figure 11 Flowchart of core A the boot thread of core B and it...
Страница 15: ...nd listen Change port OR Abort N Accept a connection Maximum number reached N Start thread Control worker Y Y Y Control worker thread start Connection available AND Not abort N Finished Y Wait for preamble Receive command Take action Send response Figure 12 TCP control interface one thread to accept connection and one or more worker threads to handle requests ...
Страница 16: ...ept a connection Maximum number reached N Start thread Tcp streamer Y Y Y Tcp streamer thread start Connection available AND Not abort N Finished Y Request data from queue Got data N Send dummy header Y Send a dummy header Y Send frame Call customizeTcpBuffer N Mark processed previously requested data Figure 13 TCP data interface one thread to accept connections and one or more to transmit the dat...
Страница 17: ...equested data Mark processed previously requested data Figure 14 Two threads collecting camera data and streaming it over UDP and Fast SPI respectively 4 2 2 Buffer Management Core A manages the buffers with the processed camera data Figure 15 shows the basic structure Core A generates data at its own predefined pace This data is then simultaneously inserted in each client s queue see Figure 15 If...
Страница 18: ... BMTdequeue T_BMT_CLIENT_HANDLE pa_tHndl The handle of the buffer manager T_BMT_BUFFER_DESC pa_ptBuffer Result The data buffer is succeded Returns T_ERROR_CODE Error code ERR_TCI_INVALID_HANDLE ERR_BMT_BUFFER_EMPTY or ERR_NONE This function removes the last item in the queue Function Name Parameters Description BMTdequeueProcessed T_BMT_CLIENT_HANDLE pa_tHndl The handle of the buffer manager Retur...
Страница 19: ... inserts one new frame into the queue The client can now continue with frame 1 Frames 3 through 5 are lost for this client and frame 1 and 2 must be dequeued in order to get to frame 6 5 In that slow case the client decided to call BMTflushClient This way frame 6 is lost too Shortly the buffer is filled with fresh data again Program start Frame 2 Frame 1 Frame 0 After some time Frame 2 Frame 1 Fra...
Страница 20: ...uded source code can be modified to one s own needs To start from scratch it is recommended to look at the example code in user_buffer_customizing c It is well documented and simply modifies the distance and amplitude data before being streamed It can be seen in the flowcharts of the threads TCP streamer thread UDP streamer thread and Ssdi streamer thread that before transmitting any camera data o...
Страница 21: ... to start with It is meant to do all kinds of processing independently Accessing the registers can be done as well as retrieving camera data It does not matter at which time and at what pace the camera data is requested and or marked processed the rest of the system continues to function normally For more detailed information on requesting data refer to Section 4 2 2 Buffer Management on page 16 ...
Страница 22: ...Cnt Mark processed previously requested data Write calculated average into register 0x0101 Write cycles counted now previous into register 0x0102 Start the same thread again Figure 18 Flow chart of the user thread 4 5 Threading To create a thread a standard POSIX interface in pthread h can be used Function Name Parameters Description pthread_create pthread_t pa_ptThread Result the thread created c...
Страница 23: ...stream twice except null Function Name Parameters Description io_setThreadIO pthread_t pa_ptThread The thread to add to the list FILE pa_InputStream The input stream to assign to the thread FILE pa_OutputStream The output stream to assign to the thread Returns T_ERROR_CODE Error code ERR_DUPLICATE_INPUT ERR_AMOUNT_EXCEEDED or ERR_NONE Secondly add the thread to the list of the thread service Funct...
Страница 24: ...rameters Description Sleep unsigned long pa_nMs Time to sleep in ms A thread can call SleepUs in conio h Function Name Parameters Description SleepUs unsigned long pa_nUs Time to sleep in µs To kill a thread from another thread this function can be called Function Name Parameters Description pthread_kill pthread_t pa_ptThread The thread to kill int signo unsupported Returns int 0 on success EINVAL...
Страница 25: ...AL otherwise Finally the semaphore can be destroyed using Function Name Parameters Description sem_destroy sem_t pa_pSem Semaphore to destroy Returns int 0 on success 1 or EINVAL otherwise 4 7 Mutex BLACKSheep supports mutexes in pthread h as per the POSIX interface Call the following function to create a mutex Function Name Parameters Description pthread_mutex_init pthread_mutex_t pa_pMutex Mutex...
Страница 26: ...5 Function Name Parameters Description pthread_mutex_lock pthread_mutex_t pa_pMutex Mutex to lock Returns int 0 on success 1 or EINVALotherwise Unlock a mutex Function Name Parameters Description pthread_mutex_unlock pthread_mutex_t pa_pMutex Mutex to unlock Returns int 0 on success 1 or EINVALotherwise ...
Страница 27: ...cuments Sentis ToF M100 User Manual available from www bluetechnix com BF561 Hardware Reference Manual available from www bluetechnix com Users Guide for Blackfin Processors available from www analog com Blackfin Compiler and Linker Manual available from www analog com Blackfin Loader Manual available from www analog com ...
Страница 28: ...port for products can be found at Bluetechnix support site Support Link https support bluetechnix at wiki Sentis ToF M100_Camera 6 2 Software Packages Software packages and software downloads are for registered customers only Software Package https support bluetechnix at wiki Sentis ToF M100_Camera 6 3 Related Products ToF Flash ToF Flash Adapter Debug Adapter ...
Страница 29: ...rogramming Sentis ToF M100 Last change 18 July 2013 Version 1 Bluetechnix 2013 Page 28 7 Document RevisionHistory Version Date Document Revision 1 2013 06 18 First preliminary of the document Table 7 1 Revision history ...
Страница 30: ...technix 2013 Page 29 8 Index B BLACKSheep Mutex 24 Semaphore 23 Threading 21 F Flashing via Bootloader 9 J JTAG Creating a session 9 Emulation 9 Flashing 9 S Sentis Software Project 3D Data acquisition 16 Camera configuration 18 Dependencies 11 Entry point 19 Flow charts 12 Support 27 ...