embeded/raspberry pi2018. 4. 23. 14:16

오.. 어떤식으로 쓸 수 있을지 모르겠지만

라즈베리 3B 되면서 PMIC가 장착되었다고 한다.


근데 벤치상에... 3B는 그나마 양호한데..

3B+의 자비없는 대기전력.. ㄷㄷ (생각해보면 Odroid U3 급이긴 한데 성능은 누가 나으려나?)

[링크 : https://www.raspberrypi.org/magpi/raspberry-pi-specs-benchmarks/]


Witty Pi 라는 HAT은 RTC와 Power on/off 기능 추가

전원 버튼이 HAT에 추가되고 그걸 누르면 On 되고

On 상태에서 Off를 누르면 라즈베리가 SW적으로 종료절차를 따르게 된다.

Suspend도 지원하는 매력적인 녀석 (23.04USD 꽤 쎄네...)

[링크 : http://www.uugear.com/witty-pi-realtime-clock-power-management-for-raspberry-pi/]

  [링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=149008]


I2C를 켜라고 하는것 봐서는 I2C를 통해 리눅스에게 전원 On/Off 상태를 알려주도록 되어 있는 듯?

Please notice that sudo is necessary to run this script. This script will automatically do 

these tasks in order:

1. Enable I2C on your Raspberry Pi

2. Install i2cctools, if it is not installed yet

3. Configure Bluetooth to use minicUART (Raspberry Pi 3 only)

4. Install wiringPi, if it is not installed yet

5. Install Witty Pi programs, if they are not installed yet

[링크 : http://www.uugear.com/doc/WittyPi_UserManual.pdf]



3B+은 2018년 3월 출시되었고

CPU 클럭 1.2->1.4로 상향

기가비트 이더넷 추가, PoE Ready

802.11ac 추가

의 차이가 존재한다.

[링크 : https://www.datenreise.de/en/raspberry-pi-3b-and-3b-in-comparison/]

'embeded > raspberry pi' 카테고리의 다른 글

rpi firmata  (0) 2018.05.11
라즈베리 2B 효용성에 대해서...  (2) 2018.05.09
rpi img 생성하기  (0) 2018.04.18
라즈베리 저전력 관련 설정  (0) 2018.04.17
라즈베리 파이 배포용 이미지 만들기  (0) 2018.02.23
Posted by 구차니
embeded/odroid2018. 4. 22. 15:30

문의를 했는데

일단.. 정체 불명의(?) 스위치는 power off시(shutdown 명령을 통한) 다시 켜는 용도

음.. 그럼 꾸욱 누르고 있으면 강제 종료 되려나?



그리고 max_freq를 500~600MHz에 거버너 performance라는데

기본이  performance고 1.7GHz인데


$ sudo cpufreq-set -f 500000 

$ sudo cat cpuinfo_cur_freq 500000

위의명령을 통해서 변경하고 확인해봐도 소비전력이 2.35W 이하로 떨어지진 않는다.

내가 모르는 다른 무언가가 있는건가?



governor는 performance로 맞추고 max_freq를 500~600Mhz 정도로 변경하면 1.5Watt까지 줄어들것 같습니다.

물론 USB 장치의 소비전류는 별도로 생각한 경우입니다.


SW1은 Power Off 상태에서 보드의 전원을 켤때 사용합니다.

오드로이드 보드는 Suspend/Resume같은 sleep 기능을 지원하지 않습니다. 

[링크 : http://com.odroid.com/sigong/nf_board/nboard_view.php?brd_id=odroidu2&bid=8238]


HDMI mini 컨버터를 두고 와서 확인을 못하는데..

켜져있는 상태에서 스위치를 누르니.. Xorg가 45%로 치솟는다.

전원 OFF UI를 그려준다고 난리피는걸까?


+

2018.04.23

음.. 말그대로 전원스위치로 인식을 하는 듯?

문득.. 리눅스 쪽으로 전원 스위치를 어떻게 인식시키는지 궁금해지네?



한참 있다가 죽어 버렸네..

power off/on 기능을 겸하는 듯

(다만 오프라인에서 켤수 없으면 죽은걸 살릴수 없으니 별 의미는 없네)

'embeded > odroid' 카테고리의 다른 글

오랫만에 지름!  (2) 2018.09.07
odroid eMMC / SD 리더 호환성  (0) 2018.05.14
odroid u3 mediawiki 설치해보니..  (0) 2018.04.19
odroid u3 소비전력 재측정  (0) 2018.04.17
odroid u3 boot.ini  (0) 2018.04.17
Posted by 구차니
embeded/Cortex-M4 Ti2018. 4. 20. 09:39

예전에도 찾았다가 해결은 못한거 같은데

일단 간단하게 결론만 말하자면


__inline 대신에

estern __inline으로 선언하면 해결된다.

(__inline에서 호출되는 변수/함수들에 static이 되어있으면

이걸 다 따라가서 static 없애는 것 보다는 옳은 방향으로 보임)



error:  #1059-D: an entity with internal linkage cannot be referenced within an inline function with external linkage


internal linkage

internal linkage를 가지는 이름은 외부 translation unit으로 공개되지 않는다. internal linkage를 가지는 이름은 다음과 같다.


namespace scope에 선언된 static specifier가 붙은 이름

namespace scope에 선언된 anonymous union의 데이터 멤버

namespace scope에 선언된 const 혹은 constexpr이 붙고 volatile은 아닌 변수

unnamed namespace에 선언된 모든 이름



external linkage

 위에서 설명한 internal linkage와 다르게 external linkage를 가지는 이름은 다른 translation unit과 공유된다. 다시 말해서 어떤 이름이 external linkage를 가진다면 그 이름은 서로 다른 translation unit에서 사용되더라도 같은 내용을 가져야 한다.


namespace scoep에 선언 된 이름 중 internal linkage가 아닌 이름.

block scope에 선언된 함수

block scope에 선언된 변수 중에서 extern으로 선언된 변수 

[링크 : https://blog.seulgi.kim/2017/08/cpp-linkage.html]


Internal Linkage: An identifier implementing internal linkage is not accessible outside the translation unit it is declared in. Any identifier within the unit can access an identifier having internal linkage. It is implemented by the keyword static. An internally linked identifier is stored in initialized or uninitialized segment of RAM.  


External Linkage: An identifier implementing external linkage is visible to every translation unit. Externally linked identifiers are shared between translation units and are considered to be located at the outermost level of the program. In practice, this means that you must define an identifier in a place which is visible to all, such that it has only one visible definition. It is the default linkage for globally scoped variables and functions. Thus, all instances of a particular identifier with external linkage refer to the same identifier in the program. The keyword extern implements external linkage.

When we use the keyword extern, we tell the linker to look for the definition elsewhere. Thus, the declaration of an externally linked identifier does not take up any space. Extern identifiers are generally stored in initialized/uninitialized or text segment of RAM. If uninitialized, the value of the identifier is set to 0 by the kernel.

[링크 : https://www.geeksforgeeks.org/internal-linkage-external-linkage-c/]


That looks perfectly fine under the C99 rules. Because stack.c is compiled with both an extern and inline declaration of the function, it will be defined with external linkage and can also be inlined within that file.


Other files will have only the declaration, and so will link to the version with external linkage.


Note that the function isn't allowed to define any modifiable objects with static storage duration, or reference any functions or global variables that aren't extern. 

[링크 : https://stackoverflow.com/.../how-to-define-a-function-to-be-inline-internal-and-external-copy-in-c99]


If you specify both inline and extern in the function definition, then the definition is used only for inlining. In no case is the function compiled on its own, not even if you refer to its address explicitly. Such an address becomes an external reference, as if you had only declared the function, and had not defined it.


This combination of inline and extern has almost the effect of a macro. The way to use it is to put a function definition in a header file with these keywords, and put another copy of the definition (lacking inline and extern) in a library file. The definition in the header file causes most calls to the function to be inlined. If any uses of the function remain, they refer to the single copy in the library. 

[링크 : https://gcc.gnu.org/onlinedocs/gcc/Inline.html]


C99 inline semantics are often misunderstood. The inline specifier serves two purposes:


First, as a compiler hint in case of static inline and extern inline declarations. Semantics remain unchanged if you remove the specifier.


Second, in case of raw inline (ie without static or extern) to provide an inline definition as an alternative to an external one, which has to be present in a different translation unit. Not providing the external one is undefined behaviour, which will normally manifest as linking failure.

[링크 : https://stackoverflow.com/questions/16245521/c99-inline-function-in-c-file]


translation unit은 C++ compilation의 기본 단위입니다. <소스 파일 하나 + 직접/간접적으로 include된 헤더파일의 내용물(전처리기 조건에 따라 몇몇은 무시)>로 구성되어 있습니다.


translation unit 한개는 object file, library나 실행가능한 프로그램으로 컴파일 될 수 있습니다. 

[링크 : http://hashcode.co.kr/questions/1244/translation-unit에-대해서]


A translation unit is the basic unit of compilation in C++. It consists of the contents of a single source file, plus the contents of any header files directly or indirectly included by it, minus those lines that were ignored using conditional preprocessing statements.


A single translation unit can be compiled into an object file, library, or executable program.


The notion of a translation unit is most often mentioned in the contexts of the One Definition Rule, and templates. 

[링크 : https://stackoverflow.com/questions/1106149/what-is-a-translation-unit-in-c]


2016/04/12 - [embeded/Cortex-M4 Ti] - keil/c99 에서 __inline ...?


Posted by 구차니
embeded/odroid2018. 4. 19. 17:29

라즈베리 2B보단 확실히 빠른데..

그렇다고 해서 쾌적하게 할 정도는 아닌거 같기도 하고..

(웹서버가 멀티프로세서 되는게 아니니 한개 CPU만 미친듯이 찍고 있기도 하고..)


테스트가 좀 더 필요하긴 함.

(다른 서버의 내용을 뽑아와서 넣고 로딩을 비교해봐야 할 듯)

'embeded > odroid' 카테고리의 다른 글

odroid eMMC / SD 리더 호환성  (0) 2018.05.14
odroid u3 저전력은 안되나..  (0) 2018.04.22
odroid u3 소비전력 재측정  (0) 2018.04.17
odroid u3 boot.ini  (0) 2018.04.17
odroid u3 libreelec  (0) 2018.02.21
Posted by 구차니
embeded/raspberry pi2018. 4. 18. 17:45

생각해보니 예전에 i.MX283 에

dd로 생성한 img 굽다가 실패한 이유가..

단순 dd로 만들고 나서 

mkfs로 포맷만 했기 때문이려나?


아래 스크립트에서는

dd로 생성 후

fdisk로 파티션을 만들고

mkfs.vfat과 mkfs.ext4로 포맷을 해주도록 되어있다.


[링크 : https://github.com/andrius/build-raspbian-image/blob/master/raspbian/build_raspbian_sd_card.sh]

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=41520]

Posted by 구차니
embeded/odroid2018. 4. 17. 22:49

어라.. 왜케 달라지고 희한하게 나오지?


 idle + lan + hdmi

 2.50

 idle + lan

 2.45

 idle + hdmi

 2.23

 idle

 2.22


'embeded > odroid' 카테고리의 다른 글

odroid u3 저전력은 안되나..  (0) 2018.04.22
odroid u3 mediawiki 설치해보니..  (0) 2018.04.19
odroid u3 boot.ini  (0) 2018.04.17
odroid u3 libreelec  (0) 2018.02.21
odroid 해상도 설정  (0) 2018.02.21
Posted by 구차니
embeded/raspberry pi2018. 4. 17. 15:29


Edit /boot/cmdline.txt and add maxcpus=N

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=99372]

[링크 : https://www.raspberrypi.org/forums/viewtopic.php?t=152692]


USB 허브 끄기 - 단, 네트워크도 죽어버림(그럼 도대체 어떻게 쓰란거지 -ㅁ-?)

#!/bin/bash

#Code to stop

/etc/init.d/networking stop

echo 0 > /sys/devices/platform/bcm2708_usb/buspower;

echo “Bus power stopping”


#!/bin/bash

#Code to start

echo 1 > /sys/devices/platform/bcm2708_usb/buspower;

echo “Bus power starting”

sleep 2;

/etc/init.d/networking start 


video output 끄기

This tip has been suggested by many people. If your system is headless (no video output) you can turn off the HDMI port with:

sudo /opt/vc/bin/tvservice -o

to turn it back on:

sudo /opt/vc/bin/tvservice -p

This command will save you around 20-30mA. 

[링크 : https://babaawesam.com/2014/01/24/power-saving-tips-for-raspberry-pi/]


/sys/devices/system/cpu/cpu0/online 이 있으면 논리적으로 on/off 가능하다는데

라즈베리에는 

/sys/devices/system/cpu/online

/sys/devices/system/cpu/offline 만 존재한다.

[링크 : https://stackoverflow.com/questions/44907731/programmatically-disable-cpu-core]


+

$ chcpu


Usage:

 chcpu [options]


Options:

  -h, --help                    print this help

  -e, --enable <cpu-list>       enable cpus

  -d, --disable <cpu-list>      disable cpus

  -c, --configure <cpu-list>    configure cpus

  -g, --deconfigure <cpu-list>  deconfigure cpus

  -p, --dispatch <mode>         set dispatching mode

  -r, --rescan                  trigger rescan of cpus

  -V, --version                 output version information and exit 


라즈베리에서는 안되네..

$ sudo chcpu -r

chcpu: This system does not support rescanning of CPUs

$ sudo chcpu -e 2

chcpu: CPU 2 is not hot pluggable 

[링크 : https://www.ibm.com/support/knowledgecenter/en/linuxonibm/com.ibm.linux.z.lgdd/lgdd_t_cpu_online.html]


+

/sys/devices/system/cpu/cpufreq/ondemand $ cat up_threshold

50 

[링크 : https://raspberrypi.stackexchange.com/questions/9034/how-to-change-the-default-governor]

'embeded > raspberry pi' 카테고리의 다른 글

rpi 3b PMIC  (0) 2018.04.23
rpi img 생성하기  (0) 2018.04.18
라즈베리 파이 배포용 이미지 만들기  (0) 2018.02.23
라즈베리 파이 번개모양 아이콘  (2) 2018.02.19
rpi config.txt avoid_safe_mode=1  (0) 2018.02.18
Posted by 구차니
embeded/odroid2018. 4. 17. 14:20

HDMI 끄는법을 찾는데

C0 에서는 setenv vpu "1"으로 VPU도 끄고

setenv hdmioutput "0" 으로 HDMI도 끌 수 있는거 같은데

For example to disable cpu1:

echo 0 | sudo tee /sys/devices/system/cpu/cpu1/online


To re-enable:

echo 1 | sudo tee /sys/devices/system/cpu/cpu1/online


CPUs are numbered 0 to 3. You can not disable CPU0.


You can confirm in dmesg:

CODE: SELECT ALL

[86696.500790] IRQ93 no longer affine to CPU1

[86696.501155] CPU1: shutdown


CODE: SELECT ALL

[86968.395163] CPU1: Booted secondary processor



You should be able to set CPU frequency with 'cpufreq-set' (example for 1Ghz):

CODE: SELECT ALL

sudo cpufreq-set -f 1000000


# Disable VPU (Video decoding engine, Saves RAM!!!)

# 0 = disabled

# 1 = enabled

setenv vpu "1"


# Disable HDMI Output (Again, saves ram!)

# 0 = disabled

# 1 = enabled

setenv hdmioutput "1" 

[링크 : https://forum.odroid.com/viewtopic.php?f=111&t=25957]


U3 에서는 해당 설정이 보이지 않는다.

[링크 : http://odroid.com/dokuwiki/doku.php?id=en:u3_tips#how_to_change_u-boot_configuration_by_bootini]


일단은.. u-boot 한번 분석해 보면 먼가 답이 나오려나?

[링크 : http://odroid.com/dokuwiki/doku.php?id=en:u3_building_u-boot]

[링크 : https://github.com/hardkernel/u-boot/tree/odroidc-v2011.03]


+

라즈베리 파이 2B 서버로 돌리는거 빼고

odroid u3를 3개 돌리면 어떨까 고민중

라즈베리는 안정적으로 2W 미만인데

odroid u3는 idle이 2W라 CPU 죽이고 하면서 한번 소비전력을 낮춰볼까 고민중

U3는 CPU disable 해보고 거버너 설정하거나 최대 클럭 설정해보면서 테스트 해봐야 할 듯..


라즈베리 2B가 나오면 머하는데 써볼까...



+

아래 명령어로 cpu 여러개 동시에 끌수는 있는데

1개만 쓴다고 해서 소비전류가 티나게 줄진 않는다.

$ sudo chcpu -d 1,2,3

CPU 1 disabled

CPU 2 disabled

CPU 3 disabled


CPU 0        2.67
CPU 0,1      2.69~2.71
CPU 0,1,2    2.69~2.71
CPU 0,1,2,3  2.69~2.71



'embeded > odroid' 카테고리의 다른 글

odroid u3 mediawiki 설치해보니..  (0) 2018.04.19
odroid u3 소비전력 재측정  (0) 2018.04.17
odroid u3 libreelec  (0) 2018.02.21
odroid 해상도 설정  (0) 2018.02.21
odroid u3 mame psp  (0) 2018.02.20
Posted by 구차니
embeded/FPGA - ALTERA2018. 4. 17. 11:32

Project Navigator에서 Hierarchy

FPGA 우클릭 후 Setting(혹은 Ctrl - Shift - E)

General의 Top-level entity를 설정해주면 된다.

물론 한번이라도 Compilation을 수행해야 목록이 갱신된다.



'embeded > FPGA - ALTERA' 카테고리의 다른 글

Nios II 컴파일 관련  (0) 2018.05.18
altera conf_done  (0) 2018.05.04
Device Installer (Quartus Prime 17.1)  (0) 2018.04.17
Quartus 프로젝트 생성  (0) 2018.04.16
Clock domain  (0) 2018.04.05
Posted by 구차니
embeded/FPGA - ALTERA2018. 4. 17. 11:05

qdz 확장자로 장치가 받아지는데

설치는 Device Installer를 통해 이루어 진다.


Step 1. Device Installer 실행


Step 2. qdz 파일이 들어있는 경로 선택


Step 3. 추가된 장치들 중에 필요한 것들을 선택


Step 4. 귀찮으니 Next


Step 5. 11메가 짜리라 금세 깐다(용량 작아서 MAX 2/5로 선택)


Step 6. 의외로 별거 없이 끝!


Step 7. Quartus Prime을 재시작 필요하다고 하는데 머. Quartus를 실행중이지 않으니 상관없나.


Step 8. 장치로 가보니 CycloneIV E/GX 외에 MAX II/V가 추가되었다!


[링크 : https://www.alteraforum.com/forum/showthread.php?t=45744]


+

qdz 라길래

Quartus Device Z... 혹시 Zip? 인가 해서 확장자 바꾸고 해보니 맞네

Zip으로 압축된 파일이었군..


dxf는 캐드파일인거 같고

ddb만 바이너리고 pll이나 ref는 ASCII 파일이다.


'embeded > FPGA - ALTERA' 카테고리의 다른 글

altera conf_done  (0) 2018.05.04
quartus 프로젝트 entry point 설정  (0) 2018.04.17
Quartus 프로젝트 생성  (0) 2018.04.16
Clock domain  (0) 2018.04.05
Nios II HAL alt_load()  (0) 2018.04.03
Posted by 구차니